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

508 lines
14 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 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;
/**
* EvaluationRun
*/
@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 EvaluationRun implements Serializable {
private static final long serialVersionUID = 1L;
private UUID runId;
private String policyKey;
private @Nullable Integer policyVersion;
private @Nullable String datasetReference;
private @Nullable Integer sampleSize;
/**
* Gets or Sets status
*/
public enum StatusEnum {
QUEUED("queued"),
RUNNING("running"),
COMPLETED("completed"),
FAILED("failed"),
CANCELLED("cancelled");
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 Integer totalSamples;
private @Nullable Integer passedSamples;
private @Nullable Integer failedSamples;
private @Nullable Double overallScore;
@Valid
private Map<String, Double> dimensionScores = new HashMap<>();
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private @Nullable OffsetDateTime startedAt;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private @Nullable OffsetDateTime completedAt;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime createdAt;
private @Nullable String errorMessage;
public EvaluationRun() {
super();
}
/**
* Constructor with only required parameters
*/
public EvaluationRun(UUID runId, String policyKey, StatusEnum status, OffsetDateTime createdAt) {
this.runId = runId;
this.policyKey = policyKey;
this.status = status;
this.createdAt = createdAt;
}
public EvaluationRun runId(UUID runId) {
this.runId = runId;
return this;
}
/**
* Get runId
* @return runId
*/
@NotNull @Valid
@Schema(name = "runId", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("runId")
public UUID getRunId() {
return runId;
}
@JsonProperty("runId")
public void setRunId(UUID runId) {
this.runId = runId;
}
public EvaluationRun policyKey(String policyKey) {
this.policyKey = policyKey;
return this;
}
/**
* Get policyKey
* @return policyKey
*/
@NotNull
@Schema(name = "policyKey", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("policyKey")
public String getPolicyKey() {
return policyKey;
}
@JsonProperty("policyKey")
public void setPolicyKey(String policyKey) {
this.policyKey = policyKey;
}
public EvaluationRun policyVersion(@Nullable Integer policyVersion) {
this.policyVersion = policyVersion;
return this;
}
/**
* Get policyVersion
* @return policyVersion
*/
@Schema(name = "policyVersion", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("policyVersion")
public @Nullable Integer getPolicyVersion() {
return policyVersion;
}
@JsonProperty("policyVersion")
public void setPolicyVersion(@Nullable Integer policyVersion) {
this.policyVersion = policyVersion;
}
public EvaluationRun datasetReference(@Nullable String datasetReference) {
this.datasetReference = datasetReference;
return this;
}
/**
* Get datasetReference
* @return datasetReference
*/
@Schema(name = "datasetReference", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("datasetReference")
public @Nullable String getDatasetReference() {
return datasetReference;
}
@JsonProperty("datasetReference")
public void setDatasetReference(@Nullable String datasetReference) {
this.datasetReference = datasetReference;
}
public EvaluationRun sampleSize(@Nullable Integer sampleSize) {
this.sampleSize = sampleSize;
return this;
}
/**
* Get sampleSize
* @return sampleSize
*/
@Schema(name = "sampleSize", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("sampleSize")
public @Nullable Integer getSampleSize() {
return sampleSize;
}
@JsonProperty("sampleSize")
public void setSampleSize(@Nullable Integer sampleSize) {
this.sampleSize = sampleSize;
}
public EvaluationRun 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 EvaluationRun totalSamples(@Nullable Integer totalSamples) {
this.totalSamples = totalSamples;
return this;
}
/**
* 总样本数
* @return totalSamples
*/
@Schema(name = "totalSamples", description = "总样本数", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("totalSamples")
public @Nullable Integer getTotalSamples() {
return totalSamples;
}
@JsonProperty("totalSamples")
public void setTotalSamples(@Nullable Integer totalSamples) {
this.totalSamples = totalSamples;
}
public EvaluationRun passedSamples(@Nullable Integer passedSamples) {
this.passedSamples = passedSamples;
return this;
}
/**
* 通过样本数
* @return passedSamples
*/
@Schema(name = "passedSamples", description = "通过样本数", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("passedSamples")
public @Nullable Integer getPassedSamples() {
return passedSamples;
}
@JsonProperty("passedSamples")
public void setPassedSamples(@Nullable Integer passedSamples) {
this.passedSamples = passedSamples;
}
public EvaluationRun failedSamples(@Nullable Integer failedSamples) {
this.failedSamples = failedSamples;
return this;
}
/**
* 未通过样本数
* @return failedSamples
*/
@Schema(name = "failedSamples", description = "未通过样本数", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("failedSamples")
public @Nullable Integer getFailedSamples() {
return failedSamples;
}
@JsonProperty("failedSamples")
public void setFailedSamples(@Nullable Integer failedSamples) {
this.failedSamples = failedSamples;
}
public EvaluationRun overallScore(@Nullable Double overallScore) {
this.overallScore = overallScore;
return this;
}
/**
* 总体评分
* @return overallScore
*/
@Schema(name = "overallScore", description = "总体评分", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("overallScore")
public @Nullable Double getOverallScore() {
return overallScore;
}
@JsonProperty("overallScore")
public void setOverallScore(@Nullable Double overallScore) {
this.overallScore = overallScore;
}
public EvaluationRun dimensionScores(Map<String, Double> dimensionScores) {
this.dimensionScores = dimensionScores;
return this;
}
public EvaluationRun putDimensionScoresItem(String key, Double dimensionScoresItem) {
if (this.dimensionScores == null) {
this.dimensionScores = new HashMap<>();
}
this.dimensionScores.put(key, dimensionScoresItem);
return this;
}
/**
* 各维度评分
* @return dimensionScores
*/
@Schema(name = "dimensionScores", description = "各维度评分", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("dimensionScores")
public Map<String, Double> getDimensionScores() {
return dimensionScores;
}
@JsonProperty("dimensionScores")
public void setDimensionScores(Map<String, Double> dimensionScores) {
this.dimensionScores = dimensionScores;
}
public EvaluationRun startedAt(@Nullable OffsetDateTime startedAt) {
this.startedAt = startedAt;
return this;
}
/**
* Get startedAt
* @return startedAt
*/
@Valid
@Schema(name = "startedAt", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("startedAt")
public @Nullable OffsetDateTime getStartedAt() {
return startedAt;
}
@JsonProperty("startedAt")
public void setStartedAt(@Nullable OffsetDateTime startedAt) {
this.startedAt = startedAt;
}
public EvaluationRun completedAt(@Nullable OffsetDateTime completedAt) {
this.completedAt = completedAt;
return this;
}
/**
* Get completedAt
* @return completedAt
*/
@Valid
@Schema(name = "completedAt", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("completedAt")
public @Nullable OffsetDateTime getCompletedAt() {
return completedAt;
}
@JsonProperty("completedAt")
public void setCompletedAt(@Nullable OffsetDateTime completedAt) {
this.completedAt = completedAt;
}
public EvaluationRun 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;
}
public EvaluationRun errorMessage(@Nullable String errorMessage) {
this.errorMessage = errorMessage;
return this;
}
/**
* Get errorMessage
* @return errorMessage
*/
@Schema(name = "errorMessage", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("errorMessage")
public @Nullable String getErrorMessage() {
return errorMessage;
}
@JsonProperty("errorMessage")
public void setErrorMessage(@Nullable String errorMessage) {
this.errorMessage = errorMessage;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EvaluationRun evaluationRun = (EvaluationRun) o;
return Objects.equals(this.runId, evaluationRun.runId) &&
Objects.equals(this.policyKey, evaluationRun.policyKey) &&
Objects.equals(this.policyVersion, evaluationRun.policyVersion) &&
Objects.equals(this.datasetReference, evaluationRun.datasetReference) &&
Objects.equals(this.sampleSize, evaluationRun.sampleSize) &&
Objects.equals(this.status, evaluationRun.status) &&
Objects.equals(this.totalSamples, evaluationRun.totalSamples) &&
Objects.equals(this.passedSamples, evaluationRun.passedSamples) &&
Objects.equals(this.failedSamples, evaluationRun.failedSamples) &&
Objects.equals(this.overallScore, evaluationRun.overallScore) &&
Objects.equals(this.dimensionScores, evaluationRun.dimensionScores) &&
Objects.equals(this.startedAt, evaluationRun.startedAt) &&
Objects.equals(this.completedAt, evaluationRun.completedAt) &&
Objects.equals(this.createdAt, evaluationRun.createdAt) &&
Objects.equals(this.errorMessage, evaluationRun.errorMessage);
}
@Override
public int hashCode() {
return Objects.hash(runId, policyKey, policyVersion, datasetReference, sampleSize, status, totalSamples, passedSamples, failedSamples, overallScore, dimensionScores, startedAt, completedAt, createdAt, errorMessage);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EvaluationRun {\n");
sb.append(" runId: ").append(toIndentedString(runId)).append("\n");
sb.append(" policyKey: ").append(toIndentedString(policyKey)).append("\n");
sb.append(" policyVersion: ").append(toIndentedString(policyVersion)).append("\n");
sb.append(" datasetReference: ").append(toIndentedString(datasetReference)).append("\n");
sb.append(" sampleSize: ").append(toIndentedString(sampleSize)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" totalSamples: ").append(toIndentedString(totalSamples)).append("\n");
sb.append(" passedSamples: ").append(toIndentedString(passedSamples)).append("\n");
sb.append(" failedSamples: ").append(toIndentedString(failedSamples)).append("\n");
sb.append(" overallScore: ").append(toIndentedString(overallScore)).append("\n");
sb.append(" dimensionScores: ").append(toIndentedString(dimensionScores)).append("\n");
sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n");
sb.append(" completedAt: ").append(toIndentedString(completedAt)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).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 ");
}
}