435 lines
12 KiB
Java
435 lines
12 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 com.muse.dto.CreatePlanningCandidateRequestSourceSnapshot;
|
||
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;
|
||
|
||
/**
|
||
* 导出任务详情
|
||
*/
|
||
|
||
@Schema(name = "ExportTaskDetail", description = "导出任务详情")
|
||
@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 ExportTaskDetail implements Serializable {
|
||
|
||
private static final long serialVersionUID = 1L;
|
||
|
||
private UUID id;
|
||
|
||
private UUID workId;
|
||
|
||
/**
|
||
* Gets or Sets format
|
||
*/
|
||
public enum FormatEnum {
|
||
TXT("txt"),
|
||
|
||
EPUB("epub"),
|
||
|
||
DOCX("docx");
|
||
|
||
private final String value;
|
||
|
||
FormatEnum(String value) {
|
||
this.value = value;
|
||
}
|
||
|
||
@JsonValue
|
||
public String getValue() {
|
||
return value;
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
return String.valueOf(value);
|
||
}
|
||
|
||
@JsonCreator
|
||
public static FormatEnum fromValue(String value) {
|
||
for (FormatEnum b : FormatEnum.values()) {
|
||
if (b.value.equals(value)) {
|
||
return b;
|
||
}
|
||
}
|
||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||
}
|
||
}
|
||
|
||
private FormatEnum format;
|
||
|
||
/**
|
||
* Gets or Sets status
|
||
*/
|
||
public enum StatusEnum {
|
||
QUEUED("queued"),
|
||
|
||
PROCESSING("processing"),
|
||
|
||
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 Integer progress;
|
||
|
||
private @Nullable String downloadCredentialId;
|
||
|
||
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
||
private @Nullable OffsetDateTime downloadExpiresAt;
|
||
|
||
private @Nullable String errorMessage;
|
||
|
||
private @Nullable CreatePlanningCandidateRequestSourceSnapshot sourceSnapshot;
|
||
|
||
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
||
private OffsetDateTime createdAt;
|
||
|
||
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
||
private @Nullable OffsetDateTime completedAt;
|
||
|
||
public ExportTaskDetail() {
|
||
super();
|
||
}
|
||
|
||
/**
|
||
* Constructor with only required parameters
|
||
*/
|
||
public ExportTaskDetail(UUID id, UUID workId, FormatEnum format, StatusEnum status, OffsetDateTime createdAt) {
|
||
this.id = id;
|
||
this.workId = workId;
|
||
this.format = format;
|
||
this.status = status;
|
||
this.createdAt = createdAt;
|
||
}
|
||
|
||
public ExportTaskDetail 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 ExportTaskDetail workId(UUID workId) {
|
||
this.workId = workId;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get workId
|
||
* @return workId
|
||
*/
|
||
@NotNull @Valid
|
||
@Schema(name = "workId", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("workId")
|
||
public UUID getWorkId() {
|
||
return workId;
|
||
}
|
||
|
||
@JsonProperty("workId")
|
||
public void setWorkId(UUID workId) {
|
||
this.workId = workId;
|
||
}
|
||
|
||
public ExportTaskDetail format(FormatEnum format) {
|
||
this.format = format;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get format
|
||
* @return format
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "format", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("format")
|
||
public FormatEnum getFormat() {
|
||
return format;
|
||
}
|
||
|
||
@JsonProperty("format")
|
||
public void setFormat(FormatEnum format) {
|
||
this.format = format;
|
||
}
|
||
|
||
public ExportTaskDetail 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 ExportTaskDetail progress(@Nullable Integer progress) {
|
||
this.progress = progress;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 处理进度百分比(0-100)
|
||
* @return progress
|
||
*/
|
||
|
||
@Schema(name = "progress", description = "处理进度百分比(0-100)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("progress")
|
||
public @Nullable Integer getProgress() {
|
||
return progress;
|
||
}
|
||
|
||
@JsonProperty("progress")
|
||
public void setProgress(@Nullable Integer progress) {
|
||
this.progress = progress;
|
||
}
|
||
|
||
public ExportTaskDetail downloadCredentialId(@Nullable String downloadCredentialId) {
|
||
this.downloadCredentialId = downloadCredentialId;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 完成后的下载凭证 ID
|
||
* @return downloadCredentialId
|
||
*/
|
||
|
||
@Schema(name = "downloadCredentialId", description = "完成后的下载凭证 ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("downloadCredentialId")
|
||
public @Nullable String getDownloadCredentialId() {
|
||
return downloadCredentialId;
|
||
}
|
||
|
||
@JsonProperty("downloadCredentialId")
|
||
public void setDownloadCredentialId(@Nullable String downloadCredentialId) {
|
||
this.downloadCredentialId = downloadCredentialId;
|
||
}
|
||
|
||
public ExportTaskDetail downloadExpiresAt(@Nullable OffsetDateTime downloadExpiresAt) {
|
||
this.downloadExpiresAt = downloadExpiresAt;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 下载凭证过期时间
|
||
* @return downloadExpiresAt
|
||
*/
|
||
@Valid
|
||
@Schema(name = "downloadExpiresAt", description = "下载凭证过期时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("downloadExpiresAt")
|
||
public @Nullable OffsetDateTime getDownloadExpiresAt() {
|
||
return downloadExpiresAt;
|
||
}
|
||
|
||
@JsonProperty("downloadExpiresAt")
|
||
public void setDownloadExpiresAt(@Nullable OffsetDateTime downloadExpiresAt) {
|
||
this.downloadExpiresAt = downloadExpiresAt;
|
||
}
|
||
|
||
public ExportTaskDetail 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 ExportTaskDetail sourceSnapshot(@Nullable CreatePlanningCandidateRequestSourceSnapshot sourceSnapshot) {
|
||
this.sourceSnapshot = sourceSnapshot;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get sourceSnapshot
|
||
* @return sourceSnapshot
|
||
*/
|
||
@Valid
|
||
@Schema(name = "sourceSnapshot", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("sourceSnapshot")
|
||
public @Nullable CreatePlanningCandidateRequestSourceSnapshot getSourceSnapshot() {
|
||
return sourceSnapshot;
|
||
}
|
||
|
||
@JsonProperty("sourceSnapshot")
|
||
public void setSourceSnapshot(@Nullable CreatePlanningCandidateRequestSourceSnapshot sourceSnapshot) {
|
||
this.sourceSnapshot = sourceSnapshot;
|
||
}
|
||
|
||
public ExportTaskDetail 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 ExportTaskDetail 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;
|
||
}
|
||
ExportTaskDetail exportTaskDetail = (ExportTaskDetail) o;
|
||
return Objects.equals(this.id, exportTaskDetail.id) &&
|
||
Objects.equals(this.workId, exportTaskDetail.workId) &&
|
||
Objects.equals(this.format, exportTaskDetail.format) &&
|
||
Objects.equals(this.status, exportTaskDetail.status) &&
|
||
Objects.equals(this.progress, exportTaskDetail.progress) &&
|
||
Objects.equals(this.downloadCredentialId, exportTaskDetail.downloadCredentialId) &&
|
||
Objects.equals(this.downloadExpiresAt, exportTaskDetail.downloadExpiresAt) &&
|
||
Objects.equals(this.errorMessage, exportTaskDetail.errorMessage) &&
|
||
Objects.equals(this.sourceSnapshot, exportTaskDetail.sourceSnapshot) &&
|
||
Objects.equals(this.createdAt, exportTaskDetail.createdAt) &&
|
||
Objects.equals(this.completedAt, exportTaskDetail.completedAt);
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
return Objects.hash(id, workId, format, status, progress, downloadCredentialId, downloadExpiresAt, errorMessage, sourceSnapshot, createdAt, completedAt);
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append("class ExportTaskDetail {\n");
|
||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||
sb.append(" workId: ").append(toIndentedString(workId)).append("\n");
|
||
sb.append(" format: ").append(toIndentedString(format)).append("\n");
|
||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||
sb.append(" progress: ").append(toIndentedString(progress)).append("\n");
|
||
sb.append(" downloadCredentialId: ").append(toIndentedString(downloadCredentialId)).append("\n");
|
||
sb.append(" downloadExpiresAt: ").append(toIndentedString(downloadExpiresAt)).append("\n");
|
||
sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n");
|
||
sb.append(" sourceSnapshot: ").append(toIndentedString(sourceSnapshot)).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 ");
|
||
}
|
||
}
|
||
|