596 lines
17 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.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.springframework.format.annotation.DateTimeFormat;
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;
/**
* SuggestionDetail
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T16:47:40.290595+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0")
public class SuggestionDetail implements Serializable {
private static final long serialVersionUID = 1L;
private UUID suggestionId;
private UUID taskId;
private @Nullable UUID blockId;
private @Nullable UUID agentId;
private @Nullable String agentName;
/**
* Gets or Sets taskType
*/
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 @Nullable TaskTypeEnum taskType;
/**
* Gets or Sets status
*/
public enum StatusEnum {
PENDING("pending"),
ACCEPTED("accepted"),
REJECTED("rejected");
private final String value;
StatusEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
private StatusEnum status;
private @Nullable String content;
private @Nullable String diffContent;
private Integer sourceVersion;
private @Nullable String sourceSnapshotId;
private @Nullable String authorizationSnapshotId;
@Valid
private Map<String, Double> qualityScores = new HashMap<>();
private @Nullable Integer qualityResultVersion;
private @Nullable String outputComplianceResultId;
private @Nullable String staticCheckResultId;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime createdAt;
public SuggestionDetail() {
super();
}
/**
* Constructor with only required parameters
*/
public SuggestionDetail(UUID suggestionId, UUID taskId, StatusEnum status, Integer sourceVersion, OffsetDateTime createdAt) {
this.suggestionId = suggestionId;
this.taskId = taskId;
this.status = status;
this.sourceVersion = sourceVersion;
this.createdAt = createdAt;
}
public SuggestionDetail suggestionId(UUID suggestionId) {
this.suggestionId = suggestionId;
return this;
}
/**
* Get suggestionId
* @return suggestionId
*/
@NotNull @Valid
@Schema(name = "suggestionId", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("suggestionId")
public UUID getSuggestionId() {
return suggestionId;
}
@JsonProperty("suggestionId")
public void setSuggestionId(UUID suggestionId) {
this.suggestionId = suggestionId;
}
public SuggestionDetail taskId(UUID taskId) {
this.taskId = taskId;
return this;
}
/**
* Get taskId
* @return taskId
*/
@NotNull @Valid
@Schema(name = "taskId", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("taskId")
public UUID getTaskId() {
return taskId;
}
@JsonProperty("taskId")
public void setTaskId(UUID taskId) {
this.taskId = taskId;
}
public SuggestionDetail blockId(@Nullable UUID blockId) {
this.blockId = blockId;
return this;
}
/**
* Get blockId
* @return blockId
*/
@Valid
@Schema(name = "blockId", 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 SuggestionDetail agentId(@Nullable UUID agentId) {
this.agentId = agentId;
return this;
}
/**
* Get agentId
* @return agentId
*/
@Valid
@Schema(name = "agentId", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("agentId")
public @Nullable UUID getAgentId() {
return agentId;
}
@JsonProperty("agentId")
public void setAgentId(@Nullable UUID agentId) {
this.agentId = agentId;
}
public SuggestionDetail agentName(@Nullable String agentName) {
this.agentName = agentName;
return this;
}
/**
* Get agentName
* @return agentName
*/
@Schema(name = "agentName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("agentName")
public @Nullable String getAgentName() {
return agentName;
}
@JsonProperty("agentName")
public void setAgentName(@Nullable String agentName) {
this.agentName = agentName;
}
public SuggestionDetail taskType(@Nullable TaskTypeEnum taskType) {
this.taskType = taskType;
return this;
}
/**
* Get taskType
* @return taskType
*/
@Schema(name = "taskType", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("taskType")
public @Nullable TaskTypeEnum getTaskType() {
return taskType;
}
@JsonProperty("taskType")
public void setTaskType(@Nullable TaskTypeEnum taskType) {
this.taskType = taskType;
}
public SuggestionDetail status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
*/
@NotNull
@Schema(name = "status", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
}
@JsonProperty("status")
public void setStatus(StatusEnum status) {
this.status = status;
}
public SuggestionDetail content(@Nullable String content) {
this.content = content;
return this;
}
/**
* 候选正文内容
* @return content
*/
@Schema(name = "content", description = "候选正文内容", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("content")
public @Nullable String getContent() {
return content;
}
@JsonProperty("content")
public void setContent(@Nullable String content) {
this.content = content;
}
public SuggestionDetail diffContent(@Nullable String diffContent) {
this.diffContent = diffContent;
return this;
}
/**
* 与当前 Block 正文的 diff 内容
* @return diffContent
*/
@Schema(name = "diffContent", description = "与当前 Block 正文的 diff 内容", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("diffContent")
public @Nullable String getDiffContent() {
return diffContent;
}
@JsonProperty("diffContent")
public void setDiffContent(@Nullable String diffContent) {
this.diffContent = diffContent;
}
public SuggestionDetail sourceVersion(Integer sourceVersion) {
this.sourceVersion = sourceVersion;
return this;
}
/**
* 生成时的来源版本号
* @return sourceVersion
*/
@NotNull
@Schema(name = "sourceVersion", description = "生成时的来源版本号", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("sourceVersion")
public Integer getSourceVersion() {
return sourceVersion;
}
@JsonProperty("sourceVersion")
public void setSourceVersion(Integer sourceVersion) {
this.sourceVersion = sourceVersion;
}
public SuggestionDetail 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 SuggestionDetail 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 SuggestionDetail qualityScores(Map<String, Double> qualityScores) {
this.qualityScores = qualityScores;
return this;
}
public SuggestionDetail putQualityScoresItem(String key, Double qualityScoresItem) {
if (this.qualityScores == null) {
this.qualityScores = new HashMap<>();
}
this.qualityScores.put(key, qualityScoresItem);
return this;
}
/**
* 各质量维度的评分
* @return qualityScores
*/
@Schema(name = "qualityScores", description = "各质量维度的评分", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("qualityScores")
public Map<String, Double> getQualityScores() {
return qualityScores;
}
@JsonProperty("qualityScores")
public void setQualityScores(Map<String, Double> qualityScores) {
this.qualityScores = qualityScores;
}
public SuggestionDetail qualityResultVersion(@Nullable Integer qualityResultVersion) {
this.qualityResultVersion = qualityResultVersion;
return this;
}
/**
* 候选质量结果版本
* @return qualityResultVersion
*/
@Schema(name = "qualityResultVersion", description = "候选质量结果版本", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("qualityResultVersion")
public @Nullable Integer getQualityResultVersion() {
return qualityResultVersion;
}
@JsonProperty("qualityResultVersion")
public void setQualityResultVersion(@Nullable Integer qualityResultVersion) {
this.qualityResultVersion = qualityResultVersion;
}
public SuggestionDetail outputComplianceResultId(@Nullable String outputComplianceResultId) {
this.outputComplianceResultId = outputComplianceResultId;
return this;
}
/**
* 输出合规结果 ID
* @return outputComplianceResultId
*/
@Schema(name = "outputComplianceResultId", description = "输出合规结果 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("outputComplianceResultId")
public @Nullable String getOutputComplianceResultId() {
return outputComplianceResultId;
}
@JsonProperty("outputComplianceResultId")
public void setOutputComplianceResultId(@Nullable String outputComplianceResultId) {
this.outputComplianceResultId = outputComplianceResultId;
}
public SuggestionDetail staticCheckResultId(@Nullable String staticCheckResultId) {
this.staticCheckResultId = staticCheckResultId;
return this;
}
/**
* 静态检查结果 ID
* @return staticCheckResultId
*/
@Schema(name = "staticCheckResultId", description = "静态检查结果 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("staticCheckResultId")
public @Nullable String getStaticCheckResultId() {
return staticCheckResultId;
}
@JsonProperty("staticCheckResultId")
public void setStaticCheckResultId(@Nullable String staticCheckResultId) {
this.staticCheckResultId = staticCheckResultId;
}
public SuggestionDetail createdAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
* @return createdAt
*/
@NotNull @Valid
@Schema(name = "createdAt", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("createdAt")
public OffsetDateTime getCreatedAt() {
return createdAt;
}
@JsonProperty("createdAt")
public void setCreatedAt(OffsetDateTime createdAt) {
this.createdAt = createdAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SuggestionDetail suggestionDetail = (SuggestionDetail) o;
return Objects.equals(this.suggestionId, suggestionDetail.suggestionId) &&
Objects.equals(this.taskId, suggestionDetail.taskId) &&
Objects.equals(this.blockId, suggestionDetail.blockId) &&
Objects.equals(this.agentId, suggestionDetail.agentId) &&
Objects.equals(this.agentName, suggestionDetail.agentName) &&
Objects.equals(this.taskType, suggestionDetail.taskType) &&
Objects.equals(this.status, suggestionDetail.status) &&
Objects.equals(this.content, suggestionDetail.content) &&
Objects.equals(this.diffContent, suggestionDetail.diffContent) &&
Objects.equals(this.sourceVersion, suggestionDetail.sourceVersion) &&
Objects.equals(this.sourceSnapshotId, suggestionDetail.sourceSnapshotId) &&
Objects.equals(this.authorizationSnapshotId, suggestionDetail.authorizationSnapshotId) &&
Objects.equals(this.qualityScores, suggestionDetail.qualityScores) &&
Objects.equals(this.qualityResultVersion, suggestionDetail.qualityResultVersion) &&
Objects.equals(this.outputComplianceResultId, suggestionDetail.outputComplianceResultId) &&
Objects.equals(this.staticCheckResultId, suggestionDetail.staticCheckResultId) &&
Objects.equals(this.createdAt, suggestionDetail.createdAt);
}
@Override
public int hashCode() {
return Objects.hash(suggestionId, taskId, blockId, agentId, agentName, taskType, status, content, diffContent, sourceVersion, sourceSnapshotId, authorizationSnapshotId, qualityScores, qualityResultVersion, outputComplianceResultId, staticCheckResultId, createdAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SuggestionDetail {\n");
sb.append(" suggestionId: ").append(toIndentedString(suggestionId)).append("\n");
sb.append(" taskId: ").append(toIndentedString(taskId)).append("\n");
sb.append(" blockId: ").append(toIndentedString(blockId)).append("\n");
sb.append(" agentId: ").append(toIndentedString(agentId)).append("\n");
sb.append(" agentName: ").append(toIndentedString(agentName)).append("\n");
sb.append(" taskType: ").append(toIndentedString(taskType)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" diffContent: ").append(toIndentedString(diffContent)).append("\n");
sb.append(" sourceVersion: ").append(toIndentedString(sourceVersion)).append("\n");
sb.append(" sourceSnapshotId: ").append(toIndentedString(sourceSnapshotId)).append("\n");
sb.append(" authorizationSnapshotId: ").append(toIndentedString(authorizationSnapshotId)).append("\n");
sb.append(" qualityScores: ").append(toIndentedString(qualityScores)).append("\n");
sb.append(" qualityResultVersion: ").append(toIndentedString(qualityResultVersion)).append("\n");
sb.append(" outputComplianceResultId: ").append(toIndentedString(outputComplianceResultId)).append("\n");
sb.append(" staticCheckResultId: ").append(toIndentedString(staticCheckResultId)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).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 ");
}
}