Content 50 + AI 39 + Knowledge 59 + Market 32 + Account 33 + Meta 16 = 229 修复 Knowledge YAML 重复 key 重新生成 TypeScript 类型包(7 文件)+ Java DTO 骨架(626 类)
365 lines
10 KiB
Java
365 lines
10 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.JsonTypeName;
|
|
import com.fasterxml.jackson.annotation.JsonValue;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
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;
|
|
|
|
/**
|
|
* CreateKnowledgeBindingRequest
|
|
*/
|
|
|
|
@JsonTypeName("createKnowledgeBinding_request")
|
|
@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 CreateKnowledgeBindingRequest implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private String commandId;
|
|
|
|
private String kbBindPrecheckId;
|
|
|
|
/**
|
|
* Gets or Sets sourceType
|
|
*/
|
|
public enum SourceTypeEnum {
|
|
USER_KB("user_kb"),
|
|
|
|
MARKET_KB("market_kb"),
|
|
|
|
GLOBAL_KB("global_kb");
|
|
|
|
private final String value;
|
|
|
|
SourceTypeEnum(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
@JsonValue
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.valueOf(value);
|
|
}
|
|
|
|
@JsonCreator
|
|
public static SourceTypeEnum fromValue(String value) {
|
|
for (SourceTypeEnum b : SourceTypeEnum.values()) {
|
|
if (b.value.equals(value)) {
|
|
return b;
|
|
}
|
|
}
|
|
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
|
}
|
|
}
|
|
|
|
private SourceTypeEnum sourceType;
|
|
|
|
private String sourceId;
|
|
|
|
private @Nullable Integer sourceVersion;
|
|
|
|
private @Nullable String authorizationSnapshotId;
|
|
|
|
/**
|
|
* Gets or Sets purposes
|
|
*/
|
|
public enum PurposesEnum {
|
|
SEARCH("search"),
|
|
|
|
GENERATE("generate"),
|
|
|
|
CHECK("check"),
|
|
|
|
EXPORT("export");
|
|
|
|
private final String value;
|
|
|
|
PurposesEnum(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
@JsonValue
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.valueOf(value);
|
|
}
|
|
|
|
@JsonCreator
|
|
public static PurposesEnum fromValue(String value) {
|
|
for (PurposesEnum b : PurposesEnum.values()) {
|
|
if (b.value.equals(value)) {
|
|
return b;
|
|
}
|
|
}
|
|
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
|
}
|
|
}
|
|
|
|
@Valid
|
|
private List<PurposesEnum> purposes = new ArrayList<>();
|
|
|
|
private @Nullable Integer expectedBindingRevision;
|
|
|
|
public CreateKnowledgeBindingRequest() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public CreateKnowledgeBindingRequest(String commandId, String kbBindPrecheckId, SourceTypeEnum sourceType, String sourceId) {
|
|
this.commandId = commandId;
|
|
this.kbBindPrecheckId = kbBindPrecheckId;
|
|
this.sourceType = sourceType;
|
|
this.sourceId = sourceId;
|
|
}
|
|
|
|
public CreateKnowledgeBindingRequest 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 CreateKnowledgeBindingRequest kbBindPrecheckId(String kbBindPrecheckId) {
|
|
this.kbBindPrecheckId = kbBindPrecheckId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 绑定预检 ID
|
|
* @return kbBindPrecheckId
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "kbBindPrecheckId", description = "绑定预检 ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("kbBindPrecheckId")
|
|
public String getKbBindPrecheckId() {
|
|
return kbBindPrecheckId;
|
|
}
|
|
|
|
@JsonProperty("kbBindPrecheckId")
|
|
public void setKbBindPrecheckId(String kbBindPrecheckId) {
|
|
this.kbBindPrecheckId = kbBindPrecheckId;
|
|
}
|
|
|
|
public CreateKnowledgeBindingRequest sourceType(SourceTypeEnum sourceType) {
|
|
this.sourceType = sourceType;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get sourceType
|
|
* @return sourceType
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "sourceType", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("sourceType")
|
|
public SourceTypeEnum getSourceType() {
|
|
return sourceType;
|
|
}
|
|
|
|
@JsonProperty("sourceType")
|
|
public void setSourceType(SourceTypeEnum sourceType) {
|
|
this.sourceType = sourceType;
|
|
}
|
|
|
|
public CreateKnowledgeBindingRequest sourceId(String sourceId) {
|
|
this.sourceId = sourceId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 来源知识库 ID
|
|
* @return sourceId
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "sourceId", description = "来源知识库 ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("sourceId")
|
|
public String getSourceId() {
|
|
return sourceId;
|
|
}
|
|
|
|
@JsonProperty("sourceId")
|
|
public void setSourceId(String sourceId) {
|
|
this.sourceId = sourceId;
|
|
}
|
|
|
|
public CreateKnowledgeBindingRequest sourceVersion(@Nullable Integer sourceVersion) {
|
|
this.sourceVersion = sourceVersion;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get sourceVersion
|
|
* @return sourceVersion
|
|
*/
|
|
|
|
@Schema(name = "sourceVersion", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("sourceVersion")
|
|
public @Nullable Integer getSourceVersion() {
|
|
return sourceVersion;
|
|
}
|
|
|
|
@JsonProperty("sourceVersion")
|
|
public void setSourceVersion(@Nullable Integer sourceVersion) {
|
|
this.sourceVersion = sourceVersion;
|
|
}
|
|
|
|
public CreateKnowledgeBindingRequest 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 CreateKnowledgeBindingRequest purposes(List<PurposesEnum> purposes) {
|
|
this.purposes = purposes;
|
|
return this;
|
|
}
|
|
|
|
public CreateKnowledgeBindingRequest addPurposesItem(PurposesEnum purposesItem) {
|
|
if (this.purposes == null) {
|
|
this.purposes = new ArrayList<>();
|
|
}
|
|
this.purposes.add(purposesItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 确认的用途
|
|
* @return purposes
|
|
*/
|
|
|
|
@Schema(name = "purposes", description = "确认的用途", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("purposes")
|
|
public List<PurposesEnum> getPurposes() {
|
|
return purposes;
|
|
}
|
|
|
|
@JsonProperty("purposes")
|
|
public void setPurposes(List<PurposesEnum> purposes) {
|
|
this.purposes = purposes;
|
|
}
|
|
|
|
public CreateKnowledgeBindingRequest expectedBindingRevision(@Nullable Integer expectedBindingRevision) {
|
|
this.expectedBindingRevision = expectedBindingRevision;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 目标绑定 revision 乐观锁
|
|
* @return expectedBindingRevision
|
|
*/
|
|
|
|
@Schema(name = "expectedBindingRevision", description = "目标绑定 revision 乐观锁", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("expectedBindingRevision")
|
|
public @Nullable Integer getExpectedBindingRevision() {
|
|
return expectedBindingRevision;
|
|
}
|
|
|
|
@JsonProperty("expectedBindingRevision")
|
|
public void setExpectedBindingRevision(@Nullable Integer expectedBindingRevision) {
|
|
this.expectedBindingRevision = expectedBindingRevision;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
CreateKnowledgeBindingRequest createKnowledgeBindingRequest = (CreateKnowledgeBindingRequest) o;
|
|
return Objects.equals(this.commandId, createKnowledgeBindingRequest.commandId) &&
|
|
Objects.equals(this.kbBindPrecheckId, createKnowledgeBindingRequest.kbBindPrecheckId) &&
|
|
Objects.equals(this.sourceType, createKnowledgeBindingRequest.sourceType) &&
|
|
Objects.equals(this.sourceId, createKnowledgeBindingRequest.sourceId) &&
|
|
Objects.equals(this.sourceVersion, createKnowledgeBindingRequest.sourceVersion) &&
|
|
Objects.equals(this.authorizationSnapshotId, createKnowledgeBindingRequest.authorizationSnapshotId) &&
|
|
Objects.equals(this.purposes, createKnowledgeBindingRequest.purposes) &&
|
|
Objects.equals(this.expectedBindingRevision, createKnowledgeBindingRequest.expectedBindingRevision);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(commandId, kbBindPrecheckId, sourceType, sourceId, sourceVersion, authorizationSnapshotId, purposes, expectedBindingRevision);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class CreateKnowledgeBindingRequest {\n");
|
|
sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n");
|
|
sb.append(" kbBindPrecheckId: ").append(toIndentedString(kbBindPrecheckId)).append("\n");
|
|
sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n");
|
|
sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n");
|
|
sb.append(" sourceVersion: ").append(toIndentedString(sourceVersion)).append("\n");
|
|
sb.append(" authorizationSnapshotId: ").append(toIndentedString(authorizationSnapshotId)).append("\n");
|
|
sb.append(" purposes: ").append(toIndentedString(purposes)).append("\n");
|
|
sb.append(" expectedBindingRevision: ").append(toIndentedString(expectedBindingRevision)).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 ");
|
|
}
|
|
}
|
|
|