322 lines
7.9 KiB
Java
322 lines
7.9 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;
|
|
|
|
/**
|
|
* JobSummary
|
|
*/
|
|
|
|
@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 JobSummary implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private UUID jobId;
|
|
|
|
private String type;
|
|
|
|
/**
|
|
* 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 String owner;
|
|
|
|
private @Nullable String createdBy;
|
|
|
|
private @Nullable Integer retryCount;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private OffsetDateTime createdAt;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime completedAt;
|
|
|
|
public JobSummary() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public JobSummary(UUID jobId, String type, StatusEnum status, String owner, OffsetDateTime createdAt) {
|
|
this.jobId = jobId;
|
|
this.type = type;
|
|
this.status = status;
|
|
this.owner = owner;
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
public JobSummary jobId(UUID jobId) {
|
|
this.jobId = jobId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get jobId
|
|
* @return jobId
|
|
*/
|
|
@NotNull @Valid
|
|
@Schema(name = "jobId", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("jobId")
|
|
public UUID getJobId() {
|
|
return jobId;
|
|
}
|
|
|
|
@JsonProperty("jobId")
|
|
public void setJobId(UUID jobId) {
|
|
this.jobId = jobId;
|
|
}
|
|
|
|
public JobSummary type(String type) {
|
|
this.type = type;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 任务类型(如 knowledge_extraction, export, evaluation 等)
|
|
* @return type
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "type", description = "任务类型(如 knowledge_extraction, export, evaluation 等)", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("type")
|
|
public String getType() {
|
|
return type;
|
|
}
|
|
|
|
@JsonProperty("type")
|
|
public void setType(String type) {
|
|
this.type = type;
|
|
}
|
|
|
|
public JobSummary 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 JobSummary owner(String owner) {
|
|
this.owner = owner;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* owner 模块
|
|
* @return owner
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "owner", description = "owner 模块", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("owner")
|
|
public String getOwner() {
|
|
return owner;
|
|
}
|
|
|
|
@JsonProperty("owner")
|
|
public void setOwner(String owner) {
|
|
this.owner = owner;
|
|
}
|
|
|
|
public JobSummary createdBy(@Nullable String createdBy) {
|
|
this.createdBy = createdBy;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 创建者
|
|
* @return createdBy
|
|
*/
|
|
|
|
@Schema(name = "createdBy", description = "创建者", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("createdBy")
|
|
public @Nullable String getCreatedBy() {
|
|
return createdBy;
|
|
}
|
|
|
|
@JsonProperty("createdBy")
|
|
public void setCreatedBy(@Nullable String createdBy) {
|
|
this.createdBy = createdBy;
|
|
}
|
|
|
|
public JobSummary retryCount(@Nullable Integer retryCount) {
|
|
this.retryCount = retryCount;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 已重试次数
|
|
* @return retryCount
|
|
*/
|
|
|
|
@Schema(name = "retryCount", description = "已重试次数", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("retryCount")
|
|
public @Nullable Integer getRetryCount() {
|
|
return retryCount;
|
|
}
|
|
|
|
@JsonProperty("retryCount")
|
|
public void setRetryCount(@Nullable Integer retryCount) {
|
|
this.retryCount = retryCount;
|
|
}
|
|
|
|
public JobSummary 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 JobSummary 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;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
JobSummary jobSummary = (JobSummary) o;
|
|
return Objects.equals(this.jobId, jobSummary.jobId) &&
|
|
Objects.equals(this.type, jobSummary.type) &&
|
|
Objects.equals(this.status, jobSummary.status) &&
|
|
Objects.equals(this.owner, jobSummary.owner) &&
|
|
Objects.equals(this.createdBy, jobSummary.createdBy) &&
|
|
Objects.equals(this.retryCount, jobSummary.retryCount) &&
|
|
Objects.equals(this.createdAt, jobSummary.createdAt) &&
|
|
Objects.equals(this.completedAt, jobSummary.completedAt);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(jobId, type, status, owner, createdBy, retryCount, createdAt, completedAt);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class JobSummary {\n");
|
|
sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n");
|
|
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
|
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
|
sb.append(" owner: ").append(toIndentedString(owner)).append("\n");
|
|
sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n");
|
|
sb.append(" retryCount: ").append(toIndentedString(retryCount)).append("\n");
|
|
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
|
|
sb.append(" completedAt: ").append(toIndentedString(completedAt)).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 ");
|
|
}
|
|
}
|
|
|