321 lines
7.9 KiB
Java
321 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;
|
|
|
|
/**
|
|
* UserJobDetail
|
|
*/
|
|
|
|
@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 UserJobDetail 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 @Nullable Object result;
|
|
|
|
private @Nullable String errorMessage;
|
|
|
|
private @Nullable Boolean retryable;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private OffsetDateTime createdAt;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime completedAt;
|
|
|
|
public UserJobDetail() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public UserJobDetail(UUID jobId, String type, StatusEnum status, OffsetDateTime createdAt) {
|
|
this.jobId = jobId;
|
|
this.type = type;
|
|
this.status = status;
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
public UserJobDetail 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 UserJobDetail type(String type) {
|
|
this.type = type;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get type
|
|
* @return type
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "type", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("type")
|
|
public String getType() {
|
|
return type;
|
|
}
|
|
|
|
@JsonProperty("type")
|
|
public void setType(String type) {
|
|
this.type = type;
|
|
}
|
|
|
|
public UserJobDetail 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 UserJobDetail result(@Nullable Object result) {
|
|
this.result = result;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 任务结果(完成时)
|
|
* @return result
|
|
*/
|
|
|
|
@Schema(name = "result", description = "任务结果(完成时)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("result")
|
|
public @Nullable Object getResult() {
|
|
return result;
|
|
}
|
|
|
|
@JsonProperty("result")
|
|
public void setResult(@Nullable Object result) {
|
|
this.result = result;
|
|
}
|
|
|
|
public UserJobDetail errorMessage(@Nullable String errorMessage) {
|
|
this.errorMessage = errorMessage;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 失败原因
|
|
* @return errorMessage
|
|
*/
|
|
|
|
@Schema(name = "errorMessage", description = "失败原因", 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 UserJobDetail retryable(@Nullable Boolean retryable) {
|
|
this.retryable = retryable;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 是否可重试
|
|
* @return retryable
|
|
*/
|
|
|
|
@Schema(name = "retryable", description = "是否可重试", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("retryable")
|
|
public @Nullable Boolean getRetryable() {
|
|
return retryable;
|
|
}
|
|
|
|
@JsonProperty("retryable")
|
|
public void setRetryable(@Nullable Boolean retryable) {
|
|
this.retryable = retryable;
|
|
}
|
|
|
|
public UserJobDetail 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 UserJobDetail 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;
|
|
}
|
|
UserJobDetail userJobDetail = (UserJobDetail) o;
|
|
return Objects.equals(this.jobId, userJobDetail.jobId) &&
|
|
Objects.equals(this.type, userJobDetail.type) &&
|
|
Objects.equals(this.status, userJobDetail.status) &&
|
|
Objects.equals(this.result, userJobDetail.result) &&
|
|
Objects.equals(this.errorMessage, userJobDetail.errorMessage) &&
|
|
Objects.equals(this.retryable, userJobDetail.retryable) &&
|
|
Objects.equals(this.createdAt, userJobDetail.createdAt) &&
|
|
Objects.equals(this.completedAt, userJobDetail.completedAt);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(jobId, type, status, result, errorMessage, retryable, createdAt, completedAt);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class UserJobDetail {\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(" result: ").append(toIndentedString(result)).append("\n");
|
|
sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n");
|
|
sb.append(" retryable: ").append(toIndentedString(retryable)).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 ");
|
|
}
|
|
}
|
|
|