oh-my-muse/docs/api-contracts/generated/java/com/muse/dto/CreateAiTaskRequest.java
zizi 10d1f97d3f feat(api): 全量补齐 6 模块 OpenAPI 契约(229 接口)+ 重新生成类型
Content 50 + AI 39 + Knowledge 59 + Market 32 + Account 33 + Meta 16 = 229
修复 Knowledge YAML 重复 key
重新生成 TypeScript 类型包(7 文件)+ Java DTO 骨架(626 类)
2026-05-24 15:06:11 +08:00

441 lines
12 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.muse.dto;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import org.springframework.lang.Nullable;
import java.io.Serializable;
import java.time.OffsetDateTime;
import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
import jakarta.annotation.Generated;
/**
* CreateAiTaskRequest
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T15:05:54.603829+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0")
public class CreateAiTaskRequest implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 任务类型
*/
public enum TaskTypeEnum {
GENERATION("generation"),
CONTINUATION("continuation"),
EXPANSION("expansion"),
POLISH("polish"),
DETECTION("detection"),
PLANNING("planning");
private final String value;
TaskTypeEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static TaskTypeEnum fromValue(String value) {
for (TaskTypeEnum b : TaskTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private TaskTypeEnum taskType;
private UUID agentId;
private @Nullable UUID workId;
private @Nullable UUID blockId;
private @Nullable UUID chapterId;
private @Nullable String prompt;
@Valid
private List<UUID> contextBlocks = new ArrayList<>();
/**
* 上下文范围,默认 work
*/
public enum ContextScopeEnum {
NONE("none"),
WORK("work"),
CHAPTER("chapter");
private final String value;
ContextScopeEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static ContextScopeEnum fromValue(String value) {
for (ContextScopeEnum b : ContextScopeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private @Nullable ContextScopeEnum contextScope;
private @Nullable String sourceSnapshotId;
private @Nullable String authorizationSnapshotId;
private @Nullable String commandId;
public CreateAiTaskRequest() {
super();
}
/**
* Constructor with only required parameters
*/
public CreateAiTaskRequest(TaskTypeEnum taskType, UUID agentId) {
this.taskType = taskType;
this.agentId = agentId;
}
public CreateAiTaskRequest taskType(TaskTypeEnum taskType) {
this.taskType = taskType;
return this;
}
/**
* 任务类型
* @return taskType
*/
@NotNull
@Schema(name = "taskType", description = "任务类型", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("taskType")
public TaskTypeEnum getTaskType() {
return taskType;
}
@JsonProperty("taskType")
public void setTaskType(TaskTypeEnum taskType) {
this.taskType = taskType;
}
public CreateAiTaskRequest agentId(UUID agentId) {
this.agentId = agentId;
return this;
}
/**
* 使用的智能体 ID
* @return agentId
*/
@NotNull @Valid
@Schema(name = "agentId", description = "使用的智能体 ID", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("agentId")
public UUID getAgentId() {
return agentId;
}
@JsonProperty("agentId")
public void setAgentId(UUID agentId) {
this.agentId = agentId;
}
public CreateAiTaskRequest workId(@Nullable UUID workId) {
this.workId = workId;
return this;
}
/**
* 目标作品 ID
* @return workId
*/
@Valid
@Schema(name = "workId", description = "目标作品 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("workId")
public @Nullable UUID getWorkId() {
return workId;
}
@JsonProperty("workId")
public void setWorkId(@Nullable UUID workId) {
this.workId = workId;
}
public CreateAiTaskRequest blockId(@Nullable UUID blockId) {
this.blockId = blockId;
return this;
}
/**
* 目标 Block ID正文生成/续写等场景必填)
* @return blockId
*/
@Valid
@Schema(name = "blockId", description = "目标 Block ID正文生成/续写等场景必填)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("blockId")
public @Nullable UUID getBlockId() {
return blockId;
}
@JsonProperty("blockId")
public void setBlockId(@Nullable UUID blockId) {
this.blockId = blockId;
}
public CreateAiTaskRequest chapterId(@Nullable UUID chapterId) {
this.chapterId = chapterId;
return this;
}
/**
* 目标章节 ID
* @return chapterId
*/
@Valid
@Schema(name = "chapterId", description = "目标章节 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("chapterId")
public @Nullable UUID getChapterId() {
return chapterId;
}
@JsonProperty("chapterId")
public void setChapterId(@Nullable UUID chapterId) {
this.chapterId = chapterId;
}
public CreateAiTaskRequest prompt(@Nullable String prompt) {
this.prompt = prompt;
return this;
}
/**
* 用户附加的提示词
* @return prompt
*/
@Schema(name = "prompt", description = "用户附加的提示词", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("prompt")
public @Nullable String getPrompt() {
return prompt;
}
@JsonProperty("prompt")
public void setPrompt(@Nullable String prompt) {
this.prompt = prompt;
}
public CreateAiTaskRequest contextBlocks(List<UUID> contextBlocks) {
this.contextBlocks = contextBlocks;
return this;
}
public CreateAiTaskRequest addContextBlocksItem(UUID contextBlocksItem) {
if (this.contextBlocks == null) {
this.contextBlocks = new ArrayList<>();
}
this.contextBlocks.add(contextBlocksItem);
return this;
}
/**
* 上下文 Block ID 列表
* @return contextBlocks
*/
@Valid
@Schema(name = "contextBlocks", description = "上下文 Block ID 列表", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("contextBlocks")
public List<UUID> getContextBlocks() {
return contextBlocks;
}
@JsonProperty("contextBlocks")
public void setContextBlocks(List<UUID> contextBlocks) {
this.contextBlocks = contextBlocks;
}
public CreateAiTaskRequest contextScope(@Nullable ContextScopeEnum contextScope) {
this.contextScope = contextScope;
return this;
}
/**
* 上下文范围,默认 work
* @return contextScope
*/
@Schema(name = "contextScope", description = "上下文范围,默认 work", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("contextScope")
public @Nullable ContextScopeEnum getContextScope() {
return contextScope;
}
@JsonProperty("contextScope")
public void setContextScope(@Nullable ContextScopeEnum contextScope) {
this.contextScope = contextScope;
}
public CreateAiTaskRequest sourceSnapshotId(@Nullable String sourceSnapshotId) {
this.sourceSnapshotId = sourceSnapshotId;
return this;
}
/**
* 来源快照 ID
* @return sourceSnapshotId
*/
@Schema(name = "sourceSnapshotId", description = "来源快照 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("sourceSnapshotId")
public @Nullable String getSourceSnapshotId() {
return sourceSnapshotId;
}
@JsonProperty("sourceSnapshotId")
public void setSourceSnapshotId(@Nullable String sourceSnapshotId) {
this.sourceSnapshotId = sourceSnapshotId;
}
public CreateAiTaskRequest authorizationSnapshotId(@Nullable String authorizationSnapshotId) {
this.authorizationSnapshotId = authorizationSnapshotId;
return this;
}
/**
* 授权快照 ID
* @return authorizationSnapshotId
*/
@Schema(name = "authorizationSnapshotId", description = "授权快照 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("authorizationSnapshotId")
public @Nullable String getAuthorizationSnapshotId() {
return authorizationSnapshotId;
}
@JsonProperty("authorizationSnapshotId")
public void setAuthorizationSnapshotId(@Nullable String authorizationSnapshotId) {
this.authorizationSnapshotId = authorizationSnapshotId;
}
public CreateAiTaskRequest commandId(@Nullable String commandId) {
this.commandId = commandId;
return this;
}
/**
* 幂等键
* @return commandId
*/
@Schema(name = "commandId", description = "幂等键", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("commandId")
public @Nullable String getCommandId() {
return commandId;
}
@JsonProperty("commandId")
public void setCommandId(@Nullable String commandId) {
this.commandId = commandId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateAiTaskRequest createAiTaskRequest = (CreateAiTaskRequest) o;
return Objects.equals(this.taskType, createAiTaskRequest.taskType) &&
Objects.equals(this.agentId, createAiTaskRequest.agentId) &&
Objects.equals(this.workId, createAiTaskRequest.workId) &&
Objects.equals(this.blockId, createAiTaskRequest.blockId) &&
Objects.equals(this.chapterId, createAiTaskRequest.chapterId) &&
Objects.equals(this.prompt, createAiTaskRequest.prompt) &&
Objects.equals(this.contextBlocks, createAiTaskRequest.contextBlocks) &&
Objects.equals(this.contextScope, createAiTaskRequest.contextScope) &&
Objects.equals(this.sourceSnapshotId, createAiTaskRequest.sourceSnapshotId) &&
Objects.equals(this.authorizationSnapshotId, createAiTaskRequest.authorizationSnapshotId) &&
Objects.equals(this.commandId, createAiTaskRequest.commandId);
}
@Override
public int hashCode() {
return Objects.hash(taskType, agentId, workId, blockId, chapterId, prompt, contextBlocks, contextScope, sourceSnapshotId, authorizationSnapshotId, commandId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateAiTaskRequest {\n");
sb.append(" taskType: ").append(toIndentedString(taskType)).append("\n");
sb.append(" agentId: ").append(toIndentedString(agentId)).append("\n");
sb.append(" workId: ").append(toIndentedString(workId)).append("\n");
sb.append(" blockId: ").append(toIndentedString(blockId)).append("\n");
sb.append(" chapterId: ").append(toIndentedString(chapterId)).append("\n");
sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n");
sb.append(" contextBlocks: ").append(toIndentedString(contextBlocks)).append("\n");
sb.append(" contextScope: ").append(toIndentedString(contextScope)).append("\n");
sb.append(" sourceSnapshotId: ").append(toIndentedString(sourceSnapshotId)).append("\n");
sb.append(" authorizationSnapshotId: ").append(toIndentedString(authorizationSnapshotId)).append("\n");
sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(@Nullable Object o) {
return o == null ? "null" : o.toString().replace("\n", "\n ");
}
}