317 lines
8.4 KiB
Java
317 lines
8.4 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.net.URI;
|
|
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 = "CreateImportTaskRequest", 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 CreateImportTaskRequest implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private String commandId;
|
|
|
|
private String fileName;
|
|
|
|
private Long fileSize;
|
|
|
|
private String fileHash;
|
|
|
|
private @Nullable String mimeType;
|
|
|
|
/**
|
|
* 导入文件格式
|
|
*/
|
|
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;
|
|
|
|
private @Nullable URI uploadUrl;
|
|
|
|
private @Nullable CreateImportTaskRequestSourceSnapshot sourceSnapshot;
|
|
|
|
public CreateImportTaskRequest() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public CreateImportTaskRequest(String commandId, String fileName, Long fileSize, String fileHash) {
|
|
this.commandId = commandId;
|
|
this.fileName = fileName;
|
|
this.fileSize = fileSize;
|
|
this.fileHash = fileHash;
|
|
}
|
|
|
|
public CreateImportTaskRequest 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 CreateImportTaskRequest fileName(String fileName) {
|
|
this.fileName = fileName;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 文件名
|
|
* @return fileName
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "fileName", description = "文件名", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("fileName")
|
|
public String getFileName() {
|
|
return fileName;
|
|
}
|
|
|
|
@JsonProperty("fileName")
|
|
public void setFileName(String fileName) {
|
|
this.fileName = fileName;
|
|
}
|
|
|
|
public CreateImportTaskRequest fileSize(Long fileSize) {
|
|
this.fileSize = fileSize;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 文件大小(字节)
|
|
* @return fileSize
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "fileSize", description = "文件大小(字节)", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("fileSize")
|
|
public Long getFileSize() {
|
|
return fileSize;
|
|
}
|
|
|
|
@JsonProperty("fileSize")
|
|
public void setFileSize(Long fileSize) {
|
|
this.fileSize = fileSize;
|
|
}
|
|
|
|
public CreateImportTaskRequest fileHash(String fileHash) {
|
|
this.fileHash = fileHash;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 文件哈希值
|
|
* @return fileHash
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "fileHash", description = "文件哈希值", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("fileHash")
|
|
public String getFileHash() {
|
|
return fileHash;
|
|
}
|
|
|
|
@JsonProperty("fileHash")
|
|
public void setFileHash(String fileHash) {
|
|
this.fileHash = fileHash;
|
|
}
|
|
|
|
public CreateImportTaskRequest mimeType(@Nullable String mimeType) {
|
|
this.mimeType = mimeType;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 文件 MIME 类型
|
|
* @return mimeType
|
|
*/
|
|
|
|
@Schema(name = "mimeType", description = "文件 MIME 类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("mimeType")
|
|
public @Nullable String getMimeType() {
|
|
return mimeType;
|
|
}
|
|
|
|
@JsonProperty("mimeType")
|
|
public void setMimeType(@Nullable String mimeType) {
|
|
this.mimeType = mimeType;
|
|
}
|
|
|
|
public CreateImportTaskRequest format(@Nullable FormatEnum format) {
|
|
this.format = format;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 导入文件格式
|
|
* @return format
|
|
*/
|
|
|
|
@Schema(name = "format", description = "导入文件格式", 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 CreateImportTaskRequest uploadUrl(@Nullable URI uploadUrl) {
|
|
this.uploadUrl = uploadUrl;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* 已上传文件的存储引用
|
|
* @return uploadUrl
|
|
*/
|
|
@Valid
|
|
@Schema(name = "uploadUrl", description = "已上传文件的存储引用", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("uploadUrl")
|
|
public @Nullable URI getUploadUrl() {
|
|
return uploadUrl;
|
|
}
|
|
|
|
@JsonProperty("uploadUrl")
|
|
public void setUploadUrl(@Nullable URI uploadUrl) {
|
|
this.uploadUrl = uploadUrl;
|
|
}
|
|
|
|
public CreateImportTaskRequest 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;
|
|
}
|
|
CreateImportTaskRequest createImportTaskRequest = (CreateImportTaskRequest) o;
|
|
return Objects.equals(this.commandId, createImportTaskRequest.commandId) &&
|
|
Objects.equals(this.fileName, createImportTaskRequest.fileName) &&
|
|
Objects.equals(this.fileSize, createImportTaskRequest.fileSize) &&
|
|
Objects.equals(this.fileHash, createImportTaskRequest.fileHash) &&
|
|
Objects.equals(this.mimeType, createImportTaskRequest.mimeType) &&
|
|
Objects.equals(this.format, createImportTaskRequest.format) &&
|
|
Objects.equals(this.uploadUrl, createImportTaskRequest.uploadUrl) &&
|
|
Objects.equals(this.sourceSnapshot, createImportTaskRequest.sourceSnapshot);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(commandId, fileName, fileSize, fileHash, mimeType, format, uploadUrl, sourceSnapshot);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class CreateImportTaskRequest {\n");
|
|
sb.append(" commandId: ").append(toIndentedString(commandId)).append("\n");
|
|
sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n");
|
|
sb.append(" fileSize: ").append(toIndentedString(fileSize)).append("\n");
|
|
sb.append(" fileHash: ").append(toIndentedString(fileHash)).append("\n");
|
|
sb.append(" mimeType: ").append(toIndentedString(mimeType)).append("\n");
|
|
sb.append(" format: ").append(toIndentedString(format)).append("\n");
|
|
sb.append(" uploadUrl: ").append(toIndentedString(uploadUrl)).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 ");
|
|
}
|
|
}
|
|
|