Content 50 + AI 39 + Knowledge 59 + Market 32 + Account 33 + Meta 16 = 229 修复 Knowledge YAML 重复 key 重新生成 TypeScript 类型包(7 文件)+ Java DTO 骨架(626 类)
381 lines
9.2 KiB
Java
381 lines
9.2 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.Block;
|
|
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;
|
|
|
|
/**
|
|
* ChapterDetail
|
|
*/
|
|
|
|
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T15:05:54.603829+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0")
|
|
public class ChapterDetail implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private UUID id;
|
|
|
|
private UUID workId;
|
|
|
|
private String title;
|
|
|
|
private Integer sortOrder;
|
|
|
|
/**
|
|
* Gets or Sets status
|
|
*/
|
|
public enum StatusEnum {
|
|
DRAFT("draft"),
|
|
|
|
COMPLETED("completed");
|
|
|
|
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 wordCount;
|
|
|
|
private @Nullable Integer blockCount;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private OffsetDateTime createdAt;
|
|
|
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
|
|
private OffsetDateTime updatedAt;
|
|
|
|
@Valid
|
|
private List<@Valid Block> blocks = new ArrayList<>();
|
|
|
|
public ChapterDetail() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Constructor with only required parameters
|
|
*/
|
|
public ChapterDetail(UUID id, UUID workId, String title, Integer sortOrder, StatusEnum status, OffsetDateTime createdAt, OffsetDateTime updatedAt) {
|
|
this.id = id;
|
|
this.workId = workId;
|
|
this.title = title;
|
|
this.sortOrder = sortOrder;
|
|
this.status = status;
|
|
this.createdAt = createdAt;
|
|
this.updatedAt = updatedAt;
|
|
}
|
|
|
|
public ChapterDetail 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 ChapterDetail 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 ChapterDetail title(String title) {
|
|
this.title = title;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get title
|
|
* @return title
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "title", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("title")
|
|
public String getTitle() {
|
|
return title;
|
|
}
|
|
|
|
@JsonProperty("title")
|
|
public void setTitle(String title) {
|
|
this.title = title;
|
|
}
|
|
|
|
public ChapterDetail sortOrder(Integer sortOrder) {
|
|
this.sortOrder = sortOrder;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get sortOrder
|
|
* @return sortOrder
|
|
*/
|
|
@NotNull
|
|
@Schema(name = "sortOrder", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("sortOrder")
|
|
public Integer getSortOrder() {
|
|
return sortOrder;
|
|
}
|
|
|
|
@JsonProperty("sortOrder")
|
|
public void setSortOrder(Integer sortOrder) {
|
|
this.sortOrder = sortOrder;
|
|
}
|
|
|
|
public ChapterDetail 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 ChapterDetail wordCount(@Nullable Integer wordCount) {
|
|
this.wordCount = wordCount;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get wordCount
|
|
* @return wordCount
|
|
*/
|
|
|
|
@Schema(name = "wordCount", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("wordCount")
|
|
public @Nullable Integer getWordCount() {
|
|
return wordCount;
|
|
}
|
|
|
|
@JsonProperty("wordCount")
|
|
public void setWordCount(@Nullable Integer wordCount) {
|
|
this.wordCount = wordCount;
|
|
}
|
|
|
|
public ChapterDetail blockCount(@Nullable Integer blockCount) {
|
|
this.blockCount = blockCount;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get blockCount
|
|
* @return blockCount
|
|
*/
|
|
|
|
@Schema(name = "blockCount", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("blockCount")
|
|
public @Nullable Integer getBlockCount() {
|
|
return blockCount;
|
|
}
|
|
|
|
@JsonProperty("blockCount")
|
|
public void setBlockCount(@Nullable Integer blockCount) {
|
|
this.blockCount = blockCount;
|
|
}
|
|
|
|
public ChapterDetail 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 ChapterDetail updatedAt(OffsetDateTime updatedAt) {
|
|
this.updatedAt = updatedAt;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get updatedAt
|
|
* @return updatedAt
|
|
*/
|
|
@NotNull @Valid
|
|
@Schema(name = "updatedAt", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
@JsonProperty("updatedAt")
|
|
public OffsetDateTime getUpdatedAt() {
|
|
return updatedAt;
|
|
}
|
|
|
|
@JsonProperty("updatedAt")
|
|
public void setUpdatedAt(OffsetDateTime updatedAt) {
|
|
this.updatedAt = updatedAt;
|
|
}
|
|
|
|
public ChapterDetail blocks(List<@Valid Block> blocks) {
|
|
this.blocks = blocks;
|
|
return this;
|
|
}
|
|
|
|
public ChapterDetail addBlocksItem(Block blocksItem) {
|
|
if (this.blocks == null) {
|
|
this.blocks = new ArrayList<>();
|
|
}
|
|
this.blocks.add(blocksItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get blocks
|
|
* @return blocks
|
|
*/
|
|
@Valid
|
|
@Schema(name = "blocks", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
@JsonProperty("blocks")
|
|
public List<@Valid Block> getBlocks() {
|
|
return blocks;
|
|
}
|
|
|
|
@JsonProperty("blocks")
|
|
public void setBlocks(List<@Valid Block> blocks) {
|
|
this.blocks = blocks;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
ChapterDetail chapterDetail = (ChapterDetail) o;
|
|
return Objects.equals(this.id, chapterDetail.id) &&
|
|
Objects.equals(this.workId, chapterDetail.workId) &&
|
|
Objects.equals(this.title, chapterDetail.title) &&
|
|
Objects.equals(this.sortOrder, chapterDetail.sortOrder) &&
|
|
Objects.equals(this.status, chapterDetail.status) &&
|
|
Objects.equals(this.wordCount, chapterDetail.wordCount) &&
|
|
Objects.equals(this.blockCount, chapterDetail.blockCount) &&
|
|
Objects.equals(this.createdAt, chapterDetail.createdAt) &&
|
|
Objects.equals(this.updatedAt, chapterDetail.updatedAt) &&
|
|
Objects.equals(this.blocks, chapterDetail.blocks);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(id, workId, title, sortOrder, status, wordCount, blockCount, createdAt, updatedAt, blocks);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class ChapterDetail {\n");
|
|
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
|
sb.append(" workId: ").append(toIndentedString(workId)).append("\n");
|
|
sb.append(" title: ").append(toIndentedString(title)).append("\n");
|
|
sb.append(" sortOrder: ").append(toIndentedString(sortOrder)).append("\n");
|
|
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
|
sb.append(" wordCount: ").append(toIndentedString(wordCount)).append("\n");
|
|
sb.append(" blockCount: ").append(toIndentedString(blockCount)).append("\n");
|
|
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
|
|
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
|
|
sb.append(" blocks: ").append(toIndentedString(blocks)).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 ");
|
|
}
|
|
}
|
|
|