409 lines
9.8 KiB
Java
409 lines
9.8 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;
|
|
|
|
/**
|
|
* 导入任务摘要(管理端列表用)
|
|
*/
|
|
|
|
@Schema(name = "ImportTaskSummary", 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 ImportTaskSummary implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private UUID id;
|
|
|
|
private UUID workId;
|
|
|
|
private @Nullable String workTitle;
|
|
|
|
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;
|
|
|
|
private @Nullable String ownerId;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private OffsetDateTime createdAt;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private @Nullable OffsetDateTime completedAt;
|
|
|
|
public ImportTaskSummary() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public ImportTaskSummary(UUID id, UUID workId, StatusEnum status, OffsetDateTime createdAt) {
|
|
this.id = id;
|
|
this.workId = workId;
|
|
this.status = status;
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
public ImportTaskSummary 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 ImportTaskSummary 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 ImportTaskSummary workTitle(@Nullable String workTitle) {
|
|
this.workTitle = workTitle;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get workTitle
|
|
* @return workTitle
|
|
*/
|
|
|
|
@Schema(name = "workTitle", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("workTitle")
|
|
public @Nullable String getWorkTitle() {
|
|
return workTitle;
|
|
}
|
|
|
|
@JsonProperty("workTitle")
|
|
public void setWorkTitle(@Nullable String workTitle) {
|
|
this.workTitle = workTitle;
|
|
}
|
|
|
|
public ImportTaskSummary 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 ImportTaskSummary 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 ImportTaskSummary 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 ImportTaskSummary 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 ImportTaskSummary ownerId(@Nullable String ownerId) {
|
|
this.ownerId = ownerId;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get ownerId
|
|
* @return ownerId
|
|
*/
|
|
|
|
@Schema(name = "ownerId", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("ownerId")
|
|
public @Nullable String getOwnerId() {
|
|
return ownerId;
|
|
}
|
|
|
|
@JsonProperty("ownerId")
|
|
public void setOwnerId(@Nullable String ownerId) {
|
|
this.ownerId = ownerId;
|
|
}
|
|
|
|
public ImportTaskSummary 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 ImportTaskSummary 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;
|
|
}
|
|
ImportTaskSummary importTaskSummary = (ImportTaskSummary) o;
|
|
return Objects.equals(this.id, importTaskSummary.id) &&
|
|
Objects.equals(this.workId, importTaskSummary.workId) &&
|
|
Objects.equals(this.workTitle, importTaskSummary.workTitle) &&
|
|
Objects.equals(this.fileName, importTaskSummary.fileName) &&
|
|
Objects.equals(this.fileSize, importTaskSummary.fileSize) &&
|
|
Objects.equals(this.format, importTaskSummary.format) &&
|
|
Objects.equals(this.status, importTaskSummary.status) &&
|
|
Objects.equals(this.ownerId, importTaskSummary.ownerId) &&
|
|
Objects.equals(this.createdAt, importTaskSummary.createdAt) &&
|
|
Objects.equals(this.completedAt, importTaskSummary.completedAt);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(id, workId, workTitle, fileName, fileSize, format, status, ownerId, createdAt, completedAt);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class ImportTaskSummary {\n");
|
|
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
|
sb.append(" workId: ").append(toIndentedString(workId)).append("\n");
|
|
sb.append(" workTitle: ").append(toIndentedString(workTitle)).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(" ownerId: ").append(toIndentedString(ownerId)).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 ");
|
|
}
|
|
}
|
|
|