zizi cbdbd79273 feat(api): 从 OpenAPI 生成 Java DTO 骨架(60 个模型类)
使用 openapi-generator-cli 7.22.0 + spring generator 生成
包含:Block/Chapter/Work/Candidate/Generation/Entitlement/Quota 等
2026-05-24 14:17:38 +08:00

294 lines
7.0 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.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;
/**
* Generation
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T14:16:55.032756+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0")
public class Generation implements Serializable {
private static final long serialVersionUID = 1L;
private UUID id;
private UUID blockId;
private UUID agentId;
/**
* Gets or Sets status
*/
public enum StatusEnum {
PENDING("pending"),
STREAMING("streaming"),
COMPLETED("completed"),
FAILED("failed");
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 UUID candidateId;
private @Nullable String errorMessage;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime createdAt;
public Generation() {
super();
}
/**
* Constructor with only required parameters
*/
public Generation(UUID id, UUID blockId, UUID agentId, StatusEnum status, OffsetDateTime createdAt) {
this.id = id;
this.blockId = blockId;
this.agentId = agentId;
this.status = status;
this.createdAt = createdAt;
}
public Generation id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
*/
@NotNull @Valid
@Schema(name = "id", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("id")
public UUID getId() {
return id;
}
@JsonProperty("id")
public void setId(UUID id) {
this.id = id;
}
public Generation blockId(UUID blockId) {
this.blockId = blockId;
return this;
}
/**
* Get blockId
* @return blockId
*/
@NotNull @Valid
@Schema(name = "blockId", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("blockId")
public UUID getBlockId() {
return blockId;
}
@JsonProperty("blockId")
public void setBlockId(UUID blockId) {
this.blockId = blockId;
}
public Generation agentId(UUID agentId) {
this.agentId = agentId;
return this;
}
/**
* Get agentId
* @return agentId
*/
@NotNull @Valid
@Schema(name = "agentId", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("agentId")
public UUID getAgentId() {
return agentId;
}
@JsonProperty("agentId")
public void setAgentId(UUID agentId) {
this.agentId = agentId;
}
public Generation 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 Generation candidateId(@Nullable UUID candidateId) {
this.candidateId = candidateId;
return this;
}
/**
* 生成完成后关联的候选 ID
* @return candidateId
*/
@Valid
@Schema(name = "candidateId", description = "生成完成后关联的候选 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("candidateId")
public @Nullable UUID getCandidateId() {
return candidateId;
}
@JsonProperty("candidateId")
public void setCandidateId(@Nullable UUID candidateId) {
this.candidateId = candidateId;
}
public Generation 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;
}
public Generation 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;
}
Generation generation = (Generation) o;
return Objects.equals(this.id, generation.id) &&
Objects.equals(this.blockId, generation.blockId) &&
Objects.equals(this.agentId, generation.agentId) &&
Objects.equals(this.status, generation.status) &&
Objects.equals(this.candidateId, generation.candidateId) &&
Objects.equals(this.errorMessage, generation.errorMessage) &&
Objects.equals(this.createdAt, generation.createdAt);
}
@Override
public int hashCode() {
return Objects.hash(id, blockId, agentId, status, candidateId, errorMessage, createdAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Generation {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" blockId: ").append(toIndentedString(blockId)).append("\n");
sb.append(" agentId: ").append(toIndentedString(agentId)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" candidateId: ").append(toIndentedString(candidateId)).append("\n");
sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).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 ");
}
}