425 lines
13 KiB
Java
425 lines
13 KiB
Java
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 com.muse.dto.ContentSourceSnapshot;
|
||
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;
|
||
|
||
/**
|
||
* 接受或修改后合并 AI suggestion 的 Content owner 写入请求。 服务端必须实时查询/校验 AI owner 的 suggestion 投影和来源状态,再写 Canonical Block。
|
||
*/
|
||
|
||
@Schema(name = "MergeBlockSuggestionRequest", description = "接受或修改后合并 AI suggestion 的 Content owner 写入请求。 服务端必须实时查询/校验 AI owner 的 suggestion 投影和来源状态,再写 Canonical Block。 ")
|
||
@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 MergeBlockSuggestionRequest implements Serializable {
|
||
|
||
private static final long serialVersionUID = 1L;
|
||
|
||
private UUID suggestionId;
|
||
|
||
private String commandId;
|
||
|
||
private Integer expectedBlockRevision;
|
||
|
||
/**
|
||
* 用户决策类型
|
||
*/
|
||
public enum DecisionTypeEnum {
|
||
ACCEPT("accept"),
|
||
|
||
MODIFY_THEN_MERGE("modify_then_merge");
|
||
|
||
private final String value;
|
||
|
||
DecisionTypeEnum(String value) {
|
||
this.value = value;
|
||
}
|
||
|
||
@JsonValue
|
||
public String getValue() {
|
||
return value;
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
return String.valueOf(value);
|
||
}
|
||
|
||
@JsonCreator
|
||
public static DecisionTypeEnum fromValue(String value) {
|
||
for (DecisionTypeEnum b : DecisionTypeEnum.values()) {
|
||
if (b.value.equals(value)) {
|
||
return b;
|
||
}
|
||
}
|
||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||
}
|
||
}
|
||
|
||
private DecisionTypeEnum decisionType;
|
||
|
||
/**
|
||
* 写入方式:原样接受或修改后合并
|
||
*/
|
||
public enum MergeModeEnum {
|
||
ACCEPT_AS_IS("accept_as_is"),
|
||
|
||
MERGE_AFTER_EDIT("merge_after_edit");
|
||
|
||
private final String value;
|
||
|
||
MergeModeEnum(String value) {
|
||
this.value = value;
|
||
}
|
||
|
||
@JsonValue
|
||
public String getValue() {
|
||
return value;
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
return String.valueOf(value);
|
||
}
|
||
|
||
@JsonCreator
|
||
public static MergeModeEnum fromValue(String value) {
|
||
for (MergeModeEnum b : MergeModeEnum.values()) {
|
||
if (b.value.equals(value)) {
|
||
return b;
|
||
}
|
||
}
|
||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||
}
|
||
}
|
||
|
||
private MergeModeEnum mergeMode;
|
||
|
||
private @Nullable String finalContent;
|
||
|
||
private @Nullable Integer qualityResultVersion;
|
||
|
||
private @Nullable String outputComplianceResultId;
|
||
|
||
private @Nullable String staticCheckResultId;
|
||
|
||
private ContentSourceSnapshot sourceSnapshot;
|
||
|
||
private @Nullable String auditReason;
|
||
|
||
public MergeBlockSuggestionRequest() {
|
||
super();
|
||
}
|
||
|
||
/**
|
||
* Constructor with only required parameters
|
||
*/
|
||
public MergeBlockSuggestionRequest(UUID suggestionId, String commandId, Integer expectedBlockRevision, DecisionTypeEnum decisionType, MergeModeEnum mergeMode, ContentSourceSnapshot sourceSnapshot) {
|
||
this.suggestionId = suggestionId;
|
||
this.commandId = commandId;
|
||
this.expectedBlockRevision = expectedBlockRevision;
|
||
this.decisionType = decisionType;
|
||
this.mergeMode = mergeMode;
|
||
this.sourceSnapshot = sourceSnapshot;
|
||
}
|
||
|
||
public MergeBlockSuggestionRequest suggestionId(UUID suggestionId) {
|
||
this.suggestionId = suggestionId;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* AI Orchestration owner 产生的候选 ID
|
||
* @return suggestionId
|
||
*/
|
||
@NotNull @Valid
|
||
@Schema(name = "suggestionId", description = "AI Orchestration owner 产生的候选 ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("suggestionId")
|
||
public UUID getSuggestionId() {
|
||
return suggestionId;
|
||
}
|
||
|
||
@JsonProperty("suggestionId")
|
||
public void setSuggestionId(UUID suggestionId) {
|
||
this.suggestionId = suggestionId;
|
||
}
|
||
|
||
public MergeBlockSuggestionRequest commandId(String commandId) {
|
||
this.commandId = commandId;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 幂等键
|
||
* @return commandId
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "commandId", description = "幂等键", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("commandId")
|
||
public String getCommandId() {
|
||
return commandId;
|
||
}
|
||
|
||
@JsonProperty("commandId")
|
||
public void setCommandId(String commandId) {
|
||
this.commandId = commandId;
|
||
}
|
||
|
||
public MergeBlockSuggestionRequest expectedBlockRevision(Integer expectedBlockRevision) {
|
||
this.expectedBlockRevision = expectedBlockRevision;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 目标 Block 当前 revision(乐观锁)
|
||
* @return expectedBlockRevision
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "expectedBlockRevision", description = "目标 Block 当前 revision(乐观锁)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("expectedBlockRevision")
|
||
public Integer getExpectedBlockRevision() {
|
||
return expectedBlockRevision;
|
||
}
|
||
|
||
@JsonProperty("expectedBlockRevision")
|
||
public void setExpectedBlockRevision(Integer expectedBlockRevision) {
|
||
this.expectedBlockRevision = expectedBlockRevision;
|
||
}
|
||
|
||
public MergeBlockSuggestionRequest decisionType(DecisionTypeEnum decisionType) {
|
||
this.decisionType = decisionType;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 用户决策类型
|
||
* @return decisionType
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "decisionType", description = "用户决策类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("decisionType")
|
||
public DecisionTypeEnum getDecisionType() {
|
||
return decisionType;
|
||
}
|
||
|
||
@JsonProperty("decisionType")
|
||
public void setDecisionType(DecisionTypeEnum decisionType) {
|
||
this.decisionType = decisionType;
|
||
}
|
||
|
||
public MergeBlockSuggestionRequest mergeMode(MergeModeEnum mergeMode) {
|
||
this.mergeMode = mergeMode;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 写入方式:原样接受或修改后合并
|
||
* @return mergeMode
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "mergeMode", description = "写入方式:原样接受或修改后合并", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("mergeMode")
|
||
public MergeModeEnum getMergeMode() {
|
||
return mergeMode;
|
||
}
|
||
|
||
@JsonProperty("mergeMode")
|
||
public void setMergeMode(MergeModeEnum mergeMode) {
|
||
this.mergeMode = mergeMode;
|
||
}
|
||
|
||
public MergeBlockSuggestionRequest finalContent(@Nullable String finalContent) {
|
||
this.finalContent = finalContent;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 修改后合并时的最终 Block 正文(mergeMode=merge_after_edit 时必填)
|
||
* @return finalContent
|
||
*/
|
||
|
||
@Schema(name = "finalContent", description = "修改后合并时的最终 Block 正文(mergeMode=merge_after_edit 时必填)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("finalContent")
|
||
public @Nullable String getFinalContent() {
|
||
return finalContent;
|
||
}
|
||
|
||
@JsonProperty("finalContent")
|
||
public void setFinalContent(@Nullable String finalContent) {
|
||
this.finalContent = finalContent;
|
||
}
|
||
|
||
public MergeBlockSuggestionRequest 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 MergeBlockSuggestionRequest 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 MergeBlockSuggestionRequest 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 MergeBlockSuggestionRequest sourceSnapshot(ContentSourceSnapshot sourceSnapshot) {
|
||
this.sourceSnapshot = sourceSnapshot;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get sourceSnapshot
|
||
* @return sourceSnapshot
|
||
*/
|
||
@NotNull @Valid
|
||
@Schema(name = "sourceSnapshot", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("sourceSnapshot")
|
||
public ContentSourceSnapshot getSourceSnapshot() {
|
||
return sourceSnapshot;
|
||
}
|
||
|
||
@JsonProperty("sourceSnapshot")
|
||
public void setSourceSnapshot(ContentSourceSnapshot sourceSnapshot) {
|
||
this.sourceSnapshot = sourceSnapshot;
|
||
}
|
||
|
||
public MergeBlockSuggestionRequest auditReason(@Nullable String auditReason) {
|
||
this.auditReason = auditReason;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 用户接受或修改合并原因
|
||
* @return auditReason
|
||
*/
|
||
|
||
@Schema(name = "auditReason", description = "用户接受或修改合并原因", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("auditReason")
|
||
public @Nullable String getAuditReason() {
|
||
return auditReason;
|
||
}
|
||
|
||
@JsonProperty("auditReason")
|
||
public void setAuditReason(@Nullable String auditReason) {
|
||
this.auditReason = auditReason;
|
||
}
|
||
|
||
@Override
|
||
public boolean equals(Object o) {
|
||
if (this == o) {
|
||
return true;
|
||
}
|
||
if (o == null || getClass() != o.getClass()) {
|
||
return false;
|
||
}
|
||
MergeBlockSuggestionRequest mergeBlockSuggestionRequest = (MergeBlockSuggestionRequest) o;
|
||
return Objects.equals(this.suggestionId, mergeBlockSuggestionRequest.suggestionId) &&
|
||
Objects.equals(this.commandId, mergeBlockSuggestionRequest.commandId) &&
|
||
Objects.equals(this.expectedBlockRevision, mergeBlockSuggestionRequest.expectedBlockRevision) &&
|
||
Objects.equals(this.decisionType, mergeBlockSuggestionRequest.decisionType) &&
|
||
Objects.equals(this.mergeMode, mergeBlockSuggestionRequest.mergeMode) &&
|
||
Objects.equals(this.finalContent, mergeBlockSuggestionRequest.finalContent) &&
|
||
Objects.equals(this.qualityResultVersion, mergeBlockSuggestionRequest.qualityResultVersion) &&
|
||
Objects.equals(this.outputComplianceResultId, mergeBlockSuggestionRequest.outputComplianceResultId) &&
|
||
Objects.equals(this.staticCheckResultId, mergeBlockSuggestionRequest.staticCheckResultId) &&
|
||
Objects.equals(this.sourceSnapshot, mergeBlockSuggestionRequest.sourceSnapshot) &&
|
||
Objects.equals(this.auditReason, mergeBlockSuggestionRequest.auditReason);
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
return Objects.hash(suggestionId, commandId, expectedBlockRevision, decisionType, mergeMode, finalContent, qualityResultVersion, outputComplianceResultId, staticCheckResultId, sourceSnapshot, auditReason);
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append("class MergeBlockSuggestionRequest {\n");
|
||
sb.append(" suggestionId: ").append(toIndentedString(suggestionId)).append("\n");
|
||
sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n");
|
||
sb.append(" expectedBlockRevision: ").append(toIndentedString(expectedBlockRevision)).append("\n");
|
||
sb.append(" decisionType: ").append(toIndentedString(decisionType)).append("\n");
|
||
sb.append(" mergeMode: ").append(toIndentedString(mergeMode)).append("\n");
|
||
sb.append(" finalContent: ").append(toIndentedString(finalContent)).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(" sourceSnapshot: ").append(toIndentedString(sourceSnapshot)).append("\n");
|
||
sb.append(" auditReason: ").append(toIndentedString(auditReason)).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 ");
|
||
}
|
||
}
|
||
|