275 lines
7.7 KiB
Java
275 lines
7.7 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.CreateImportTaskRequestSourceSnapshot;
|
||
import java.util.ArrayList;
|
||
import java.util.Arrays;
|
||
import java.util.List;
|
||
import java.util.UUID;
|
||
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 = "CreateExportTaskRequest", 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 CreateExportTaskRequest implements Serializable {
|
||
|
||
private static final long serialVersionUID = 1L;
|
||
|
||
private String commandId;
|
||
|
||
/**
|
||
* 导出格式
|
||
*/
|
||
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;
|
||
|
||
@Valid
|
||
private List<UUID> includeChapters = new ArrayList<>();
|
||
|
||
private Boolean includeMetadata = true;
|
||
|
||
private Boolean includePlanning = false;
|
||
|
||
private @Nullable CreateImportTaskRequestSourceSnapshot sourceSnapshot;
|
||
|
||
public CreateExportTaskRequest() {
|
||
super();
|
||
}
|
||
|
||
/**
|
||
* Constructor with only required parameters
|
||
*/
|
||
public CreateExportTaskRequest(String commandId, FormatEnum format) {
|
||
this.commandId = commandId;
|
||
this.format = format;
|
||
}
|
||
|
||
public CreateExportTaskRequest commandId(String commandId) {
|
||
this.commandId = commandId;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 幂等键
|
||
* @return commandId
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "commandId", description = "幂等键", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("commandId")
|
||
public String getCommandId() {
|
||
return commandId;
|
||
}
|
||
|
||
@JsonProperty("commandId")
|
||
public void setCommandId(String commandId) {
|
||
this.commandId = commandId;
|
||
}
|
||
|
||
public CreateExportTaskRequest format(FormatEnum format) {
|
||
this.format = format;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 导出格式
|
||
* @return format
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "format", description = "导出格式", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("format")
|
||
public FormatEnum getFormat() {
|
||
return format;
|
||
}
|
||
|
||
@JsonProperty("format")
|
||
public void setFormat(FormatEnum format) {
|
||
this.format = format;
|
||
}
|
||
|
||
public CreateExportTaskRequest includeChapters(List<UUID> includeChapters) {
|
||
this.includeChapters = includeChapters;
|
||
return this;
|
||
}
|
||
|
||
public CreateExportTaskRequest addIncludeChaptersItem(UUID includeChaptersItem) {
|
||
if (this.includeChapters == null) {
|
||
this.includeChapters = new ArrayList<>();
|
||
}
|
||
this.includeChapters.add(includeChaptersItem);
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 指定导出章节 ID,空数组表示导出全部
|
||
* @return includeChapters
|
||
*/
|
||
@Valid
|
||
@Schema(name = "includeChapters", description = "指定导出章节 ID,空数组表示导出全部", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("includeChapters")
|
||
public List<UUID> getIncludeChapters() {
|
||
return includeChapters;
|
||
}
|
||
|
||
@JsonProperty("includeChapters")
|
||
public void setIncludeChapters(List<UUID> includeChapters) {
|
||
this.includeChapters = includeChapters;
|
||
}
|
||
|
||
public CreateExportTaskRequest includeMetadata(Boolean includeMetadata) {
|
||
this.includeMetadata = includeMetadata;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 是否包含元数据
|
||
* @return includeMetadata
|
||
*/
|
||
|
||
@Schema(name = "includeMetadata", description = "是否包含元数据", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("includeMetadata")
|
||
public Boolean getIncludeMetadata() {
|
||
return includeMetadata;
|
||
}
|
||
|
||
@JsonProperty("includeMetadata")
|
||
public void setIncludeMetadata(Boolean includeMetadata) {
|
||
this.includeMetadata = includeMetadata;
|
||
}
|
||
|
||
public CreateExportTaskRequest includePlanning(Boolean includePlanning) {
|
||
this.includePlanning = includePlanning;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 是否包含规划数据
|
||
* @return includePlanning
|
||
*/
|
||
|
||
@Schema(name = "includePlanning", description = "是否包含规划数据", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("includePlanning")
|
||
public Boolean getIncludePlanning() {
|
||
return includePlanning;
|
||
}
|
||
|
||
@JsonProperty("includePlanning")
|
||
public void setIncludePlanning(Boolean includePlanning) {
|
||
this.includePlanning = includePlanning;
|
||
}
|
||
|
||
public CreateExportTaskRequest sourceSnapshot(@Nullable CreateImportTaskRequestSourceSnapshot sourceSnapshot) {
|
||
this.sourceSnapshot = sourceSnapshot;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get sourceSnapshot
|
||
* @return sourceSnapshot
|
||
*/
|
||
@Valid
|
||
@Schema(name = "sourceSnapshot", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("sourceSnapshot")
|
||
public @Nullable CreateImportTaskRequestSourceSnapshot getSourceSnapshot() {
|
||
return sourceSnapshot;
|
||
}
|
||
|
||
@JsonProperty("sourceSnapshot")
|
||
public void setSourceSnapshot(@Nullable CreateImportTaskRequestSourceSnapshot sourceSnapshot) {
|
||
this.sourceSnapshot = sourceSnapshot;
|
||
}
|
||
|
||
@Override
|
||
public boolean equals(Object o) {
|
||
if (this == o) {
|
||
return true;
|
||
}
|
||
if (o == null || getClass() != o.getClass()) {
|
||
return false;
|
||
}
|
||
CreateExportTaskRequest createExportTaskRequest = (CreateExportTaskRequest) o;
|
||
return Objects.equals(this.commandId, createExportTaskRequest.commandId) &&
|
||
Objects.equals(this.format, createExportTaskRequest.format) &&
|
||
Objects.equals(this.includeChapters, createExportTaskRequest.includeChapters) &&
|
||
Objects.equals(this.includeMetadata, createExportTaskRequest.includeMetadata) &&
|
||
Objects.equals(this.includePlanning, createExportTaskRequest.includePlanning) &&
|
||
Objects.equals(this.sourceSnapshot, createExportTaskRequest.sourceSnapshot);
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
return Objects.hash(commandId, format, includeChapters, includeMetadata, includePlanning, sourceSnapshot);
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append("class CreateExportTaskRequest {\n");
|
||
sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n");
|
||
sb.append(" format: ").append(toIndentedString(format)).append("\n");
|
||
sb.append(" includeChapters: ").append(toIndentedString(includeChapters)).append("\n");
|
||
sb.append(" includeMetadata: ").append(toIndentedString(includeMetadata)).append("\n");
|
||
sb.append(" includePlanning: ").append(toIndentedString(includePlanning)).append("\n");
|
||
sb.append(" sourceSnapshot: ").append(toIndentedString(sourceSnapshot)).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 ");
|
||
}
|
||
}
|
||
|