560 lines
14 KiB
Java
560 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.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
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;
|
|
|
|
/**
|
|
* JobDetail
|
|
*/
|
|
|
|
@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 JobDetail 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 Object input;
|
|
|
|
private @Nullable Object result;
|
|
|
|
private @Nullable String errorMessage;
|
|
|
|
private @Nullable String failedStage;
|
|
|
|
private @Nullable Boolean retryable;
|
|
|
|
private @Nullable Integer retryCount;
|
|
|
|
private @Nullable String retryGroupId;
|
|
|
|
private @Nullable String correlationId;
|
|
|
|
@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;
|
|
|
|
@Valid
|
|
private List<String> nextActions = new ArrayList<>();
|
|
|
|
public JobDetail() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public JobDetail(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 JobDetail 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 JobDetail 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 JobDetail 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 JobDetail owner(String owner) {
|
|
this.owner = owner;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get owner
|
|
* @return owner
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "owner", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("owner")
|
|
public String getOwner() {
|
|
return owner;
|
|
}
|
|
|
|
@JsonProperty("owner")
|
|
public void setOwner(String owner) {
|
|
this.owner = owner;
|
|
}
|
|
|
|
public JobDetail createdBy(@Nullable String createdBy) {
|
|
this.createdBy = createdBy;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get createdBy
|
|
* @return createdBy
|
|
*/
|
|
|
|
@Schema(name = "createdBy", 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 JobDetail input(@Nullable Object input) {
|
|
this.input = input;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 任务输入参数
|
|
* @return input
|
|
*/
|
|
|
|
@Schema(name = "input", description = "任务输入参数", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("input")
|
|
public @Nullable Object getInput() {
|
|
return input;
|
|
}
|
|
|
|
@JsonProperty("input")
|
|
public void setInput(@Nullable Object input) {
|
|
this.input = input;
|
|
}
|
|
|
|
public JobDetail 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 JobDetail 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 JobDetail failedStage(@Nullable String failedStage) {
|
|
this.failedStage = failedStage;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 失败阶段
|
|
* @return failedStage
|
|
*/
|
|
|
|
@Schema(name = "failedStage", description = "失败阶段", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("failedStage")
|
|
public @Nullable String getFailedStage() {
|
|
return failedStage;
|
|
}
|
|
|
|
@JsonProperty("failedStage")
|
|
public void setFailedStage(@Nullable String failedStage) {
|
|
this.failedStage = failedStage;
|
|
}
|
|
|
|
public JobDetail 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 JobDetail retryCount(@Nullable Integer retryCount) {
|
|
this.retryCount = retryCount;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get retryCount
|
|
* @return retryCount
|
|
*/
|
|
|
|
@Schema(name = "retryCount", 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 JobDetail retryGroupId(@Nullable String retryGroupId) {
|
|
this.retryGroupId = retryGroupId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 重试组 ID
|
|
* @return retryGroupId
|
|
*/
|
|
|
|
@Schema(name = "retryGroupId", description = "重试组 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("retryGroupId")
|
|
public @Nullable String getRetryGroupId() {
|
|
return retryGroupId;
|
|
}
|
|
|
|
@JsonProperty("retryGroupId")
|
|
public void setRetryGroupId(@Nullable String retryGroupId) {
|
|
this.retryGroupId = retryGroupId;
|
|
}
|
|
|
|
public JobDetail correlationId(@Nullable String correlationId) {
|
|
this.correlationId = correlationId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 关联 ID
|
|
* @return correlationId
|
|
*/
|
|
|
|
@Schema(name = "correlationId", description = "关联 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("correlationId")
|
|
public @Nullable String getCorrelationId() {
|
|
return correlationId;
|
|
}
|
|
|
|
@JsonProperty("correlationId")
|
|
public void setCorrelationId(@Nullable String correlationId) {
|
|
this.correlationId = correlationId;
|
|
}
|
|
|
|
public JobDetail 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 JobDetail 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 JobDetail 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 JobDetail nextActions(List<String> nextActions) {
|
|
this.nextActions = nextActions;
|
|
return this;
|
|
}
|
|
|
|
public JobDetail addNextActionsItem(String nextActionsItem) {
|
|
if (this.nextActions == null) {
|
|
this.nextActions = new ArrayList<>();
|
|
}
|
|
this.nextActions.add(nextActionsItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 建议的下一步操作
|
|
* @return nextActions
|
|
*/
|
|
|
|
@Schema(name = "nextActions", description = "建议的下一步操作", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("nextActions")
|
|
public List<String> getNextActions() {
|
|
return nextActions;
|
|
}
|
|
|
|
@JsonProperty("nextActions")
|
|
public void setNextActions(List<String> nextActions) {
|
|
this.nextActions = nextActions;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
JobDetail jobDetail = (JobDetail) o;
|
|
return Objects.equals(this.jobId, jobDetail.jobId) &&
|
|
Objects.equals(this.type, jobDetail.type) &&
|
|
Objects.equals(this.status, jobDetail.status) &&
|
|
Objects.equals(this.owner, jobDetail.owner) &&
|
|
Objects.equals(this.createdBy, jobDetail.createdBy) &&
|
|
Objects.equals(this.input, jobDetail.input) &&
|
|
Objects.equals(this.result, jobDetail.result) &&
|
|
Objects.equals(this.errorMessage, jobDetail.errorMessage) &&
|
|
Objects.equals(this.failedStage, jobDetail.failedStage) &&
|
|
Objects.equals(this.retryable, jobDetail.retryable) &&
|
|
Objects.equals(this.retryCount, jobDetail.retryCount) &&
|
|
Objects.equals(this.retryGroupId, jobDetail.retryGroupId) &&
|
|
Objects.equals(this.correlationId, jobDetail.correlationId) &&
|
|
Objects.equals(this.startedAt, jobDetail.startedAt) &&
|
|
Objects.equals(this.completedAt, jobDetail.completedAt) &&
|
|
Objects.equals(this.createdAt, jobDetail.createdAt) &&
|
|
Objects.equals(this.nextActions, jobDetail.nextActions);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(jobId, type, status, owner, createdBy, input, result, errorMessage, failedStage, retryable, retryCount, retryGroupId, correlationId, startedAt, completedAt, createdAt, nextActions);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class JobDetail {\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(" input: ").append(toIndentedString(input)).append("\n");
|
|
sb.append(" result: ").append(toIndentedString(result)).append("\n");
|
|
sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n");
|
|
sb.append(" failedStage: ").append(toIndentedString(failedStage)).append("\n");
|
|
sb.append(" retryable: ").append(toIndentedString(retryable)).append("\n");
|
|
sb.append(" retryCount: ").append(toIndentedString(retryCount)).append("\n");
|
|
sb.append(" retryGroupId: ").append(toIndentedString(retryGroupId)).append("\n");
|
|
sb.append(" correlationId: ").append(toIndentedString(correlationId)).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(" nextActions: ").append(toIndentedString(nextActions)).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 ");
|
|
}
|
|
}
|
|
|