586 lines
15 KiB
Java
586 lines
15 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.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;
|
||
|
||
/**
|
||
* 导入任务详情
|
||
*/
|
||
|
||
@Schema(name = "ImportTaskDetail", 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 ImportTaskDetail implements Serializable {
|
||
|
||
private static final long serialVersionUID = 1L;
|
||
|
||
private UUID id;
|
||
|
||
private UUID workId;
|
||
|
||
private @Nullable String fileName;
|
||
|
||
private @Nullable Long fileSize;
|
||
|
||
/**
|
||
* Gets or Sets format
|
||
*/
|
||
public enum FormatEnum {
|
||
TXT("txt"),
|
||
|
||
EPUB("epub"),
|
||
|
||
DOCX("docx"),
|
||
|
||
MARKDOWN("markdown");
|
||
|
||
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 @Nullable 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;
|
||
|
||
/**
|
||
* 文件扫描状态
|
||
*/
|
||
public enum ScanStatusEnum {
|
||
PENDING("pending"),
|
||
|
||
PASSED("passed"),
|
||
|
||
BLOCKED("blocked"),
|
||
|
||
FAILED("failed");
|
||
|
||
private final String value;
|
||
|
||
ScanStatusEnum(String value) {
|
||
this.value = value;
|
||
}
|
||
|
||
@JsonValue
|
||
public String getValue() {
|
||
return value;
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
return String.valueOf(value);
|
||
}
|
||
|
||
@JsonCreator
|
||
public static ScanStatusEnum fromValue(String value) {
|
||
for (ScanStatusEnum b : ScanStatusEnum.values()) {
|
||
if (b.value.equals(value)) {
|
||
return b;
|
||
}
|
||
}
|
||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||
}
|
||
}
|
||
|
||
private @Nullable ScanStatusEnum scanStatus;
|
||
|
||
private @Nullable Integer progress;
|
||
|
||
private @Nullable String errorMessage;
|
||
|
||
private @Nullable String failedStage;
|
||
|
||
private @Nullable Boolean retryable;
|
||
|
||
@Valid
|
||
private List<String> nextActions = new ArrayList<>();
|
||
|
||
private @Nullable CreatePlanningCandidateRequestSourceSnapshot sourceSnapshot;
|
||
|
||
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
||
private OffsetDateTime createdAt;
|
||
|
||
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
||
private @Nullable OffsetDateTime completedAt;
|
||
|
||
public ImportTaskDetail() {
|
||
super();
|
||
}
|
||
|
||
/**
|
||
* Constructor with only required parameters
|
||
*/
|
||
public ImportTaskDetail(UUID id, UUID workId, StatusEnum status, OffsetDateTime createdAt) {
|
||
this.id = id;
|
||
this.workId = workId;
|
||
this.status = status;
|
||
this.createdAt = createdAt;
|
||
}
|
||
|
||
public ImportTaskDetail 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 ImportTaskDetail 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 ImportTaskDetail fileName(@Nullable String fileName) {
|
||
this.fileName = fileName;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get fileName
|
||
* @return fileName
|
||
*/
|
||
|
||
@Schema(name = "fileName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("fileName")
|
||
public @Nullable String getFileName() {
|
||
return fileName;
|
||
}
|
||
|
||
@JsonProperty("fileName")
|
||
public void setFileName(@Nullable String fileName) {
|
||
this.fileName = fileName;
|
||
}
|
||
|
||
public ImportTaskDetail fileSize(@Nullable Long fileSize) {
|
||
this.fileSize = fileSize;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get fileSize
|
||
* @return fileSize
|
||
*/
|
||
|
||
@Schema(name = "fileSize", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("fileSize")
|
||
public @Nullable Long getFileSize() {
|
||
return fileSize;
|
||
}
|
||
|
||
@JsonProperty("fileSize")
|
||
public void setFileSize(@Nullable Long fileSize) {
|
||
this.fileSize = fileSize;
|
||
}
|
||
|
||
public ImportTaskDetail format(@Nullable FormatEnum format) {
|
||
this.format = format;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get format
|
||
* @return format
|
||
*/
|
||
|
||
@Schema(name = "format", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("format")
|
||
public @Nullable FormatEnum getFormat() {
|
||
return format;
|
||
}
|
||
|
||
@JsonProperty("format")
|
||
public void setFormat(@Nullable FormatEnum format) {
|
||
this.format = format;
|
||
}
|
||
|
||
public ImportTaskDetail 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 ImportTaskDetail scanStatus(@Nullable ScanStatusEnum scanStatus) {
|
||
this.scanStatus = scanStatus;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 文件扫描状态
|
||
* @return scanStatus
|
||
*/
|
||
|
||
@Schema(name = "scanStatus", description = "文件扫描状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("scanStatus")
|
||
public @Nullable ScanStatusEnum getScanStatus() {
|
||
return scanStatus;
|
||
}
|
||
|
||
@JsonProperty("scanStatus")
|
||
public void setScanStatus(@Nullable ScanStatusEnum scanStatus) {
|
||
this.scanStatus = scanStatus;
|
||
}
|
||
|
||
public ImportTaskDetail 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 ImportTaskDetail 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 ImportTaskDetail 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 ImportTaskDetail 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 ImportTaskDetail nextActions(List<String> nextActions) {
|
||
this.nextActions = nextActions;
|
||
return this;
|
||
}
|
||
|
||
public ImportTaskDetail 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;
|
||
}
|
||
|
||
public ImportTaskDetail 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 ImportTaskDetail 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 ImportTaskDetail 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;
|
||
}
|
||
ImportTaskDetail importTaskDetail = (ImportTaskDetail) o;
|
||
return Objects.equals(this.id, importTaskDetail.id) &&
|
||
Objects.equals(this.workId, importTaskDetail.workId) &&
|
||
Objects.equals(this.fileName, importTaskDetail.fileName) &&
|
||
Objects.equals(this.fileSize, importTaskDetail.fileSize) &&
|
||
Objects.equals(this.format, importTaskDetail.format) &&
|
||
Objects.equals(this.status, importTaskDetail.status) &&
|
||
Objects.equals(this.scanStatus, importTaskDetail.scanStatus) &&
|
||
Objects.equals(this.progress, importTaskDetail.progress) &&
|
||
Objects.equals(this.errorMessage, importTaskDetail.errorMessage) &&
|
||
Objects.equals(this.failedStage, importTaskDetail.failedStage) &&
|
||
Objects.equals(this.retryable, importTaskDetail.retryable) &&
|
||
Objects.equals(this.nextActions, importTaskDetail.nextActions) &&
|
||
Objects.equals(this.sourceSnapshot, importTaskDetail.sourceSnapshot) &&
|
||
Objects.equals(this.createdAt, importTaskDetail.createdAt) &&
|
||
Objects.equals(this.completedAt, importTaskDetail.completedAt);
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
return Objects.hash(id, workId, fileName, fileSize, format, status, scanStatus, progress, errorMessage, failedStage, retryable, nextActions, sourceSnapshot, createdAt, completedAt);
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append("class ImportTaskDetail {\n");
|
||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||
sb.append(" workId: ").append(toIndentedString(workId)).append("\n");
|
||
sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n");
|
||
sb.append(" fileSize: ").append(toIndentedString(fileSize)).append("\n");
|
||
sb.append(" format: ").append(toIndentedString(format)).append("\n");
|
||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||
sb.append(" scanStatus: ").append(toIndentedString(scanStatus)).append("\n");
|
||
sb.append(" progress: ").append(toIndentedString(progress)).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(" nextActions: ").append(toIndentedString(nextActions)).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 ");
|
||
}
|
||
}
|
||
|