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.AdminChapterSummary; import com.muse.dto.AdminWorkDetailExceptionSummary; import com.muse.dto.AdminWorkDetailGovernanceHistoryInner; 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 = "AdminWorkDetail", 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 AdminWorkDetail implements Serializable { private static final long serialVersionUID = 1L; private UUID id; private String title; private @Nullable String description; private @Nullable String genre; /** * Gets or Sets status */ public enum StatusEnum { DRAFT("draft"), ACTIVE("active"), ARCHIVED("archived"); 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 String ownerId; private @Nullable Integer wordCount; private @Nullable Integer chapterCount; @Valid private List<@Valid AdminChapterSummary> chapterSummaries = new ArrayList<>(); private @Nullable AdminWorkDetailExceptionSummary exceptionSummary; @Valid private List<@Valid AdminWorkDetailGovernanceHistoryInner> governanceHistory = new ArrayList<>(); @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime createdAt; @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) private OffsetDateTime updatedAt; public AdminWorkDetail() { super(); } /** * Constructor with only required parameters */ public AdminWorkDetail(UUID id, String title, StatusEnum status, String ownerId, OffsetDateTime createdAt, OffsetDateTime updatedAt) { this.id = id; this.title = title; this.status = status; this.ownerId = ownerId; this.createdAt = createdAt; this.updatedAt = updatedAt; } public AdminWorkDetail 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 AdminWorkDetail 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 AdminWorkDetail description(@Nullable String description) { this.description = description; return this; } /** * Get description * @return description */ @Schema(name = "description", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("description") public @Nullable String getDescription() { return description; } @JsonProperty("description") public void setDescription(@Nullable String description) { this.description = description; } public AdminWorkDetail genre(@Nullable String genre) { this.genre = genre; return this; } /** * Get genre * @return genre */ @Schema(name = "genre", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("genre") public @Nullable String getGenre() { return genre; } @JsonProperty("genre") public void setGenre(@Nullable String genre) { this.genre = genre; } public AdminWorkDetail 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 AdminWorkDetail ownerId(String ownerId) { this.ownerId = ownerId; return this; } /** * 作品所有者用户 ID * @return ownerId */ @NotNull @Schema(name = "ownerId", description = "作品所有者用户 ID", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("ownerId") public String getOwnerId() { return ownerId; } @JsonProperty("ownerId") public void setOwnerId(String ownerId) { this.ownerId = ownerId; } public AdminWorkDetail 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 AdminWorkDetail chapterCount(@Nullable Integer chapterCount) { this.chapterCount = chapterCount; return this; } /** * Get chapterCount * @return chapterCount */ @Schema(name = "chapterCount", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("chapterCount") public @Nullable Integer getChapterCount() { return chapterCount; } @JsonProperty("chapterCount") public void setChapterCount(@Nullable Integer chapterCount) { this.chapterCount = chapterCount; } public AdminWorkDetail chapterSummaries(List<@Valid AdminChapterSummary> chapterSummaries) { this.chapterSummaries = chapterSummaries; return this; } public AdminWorkDetail addChapterSummariesItem(AdminChapterSummary chapterSummariesItem) { if (this.chapterSummaries == null) { this.chapterSummaries = new ArrayList<>(); } this.chapterSummaries.add(chapterSummariesItem); return this; } /** * 章节摘要列表(不含正文全文) * @return chapterSummaries */ @Valid @Schema(name = "chapterSummaries", description = "章节摘要列表(不含正文全文)", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("chapterSummaries") public List<@Valid AdminChapterSummary> getChapterSummaries() { return chapterSummaries; } @JsonProperty("chapterSummaries") public void setChapterSummaries(List<@Valid AdminChapterSummary> chapterSummaries) { this.chapterSummaries = chapterSummaries; } public AdminWorkDetail exceptionSummary(@Nullable AdminWorkDetailExceptionSummary exceptionSummary) { this.exceptionSummary = exceptionSummary; return this; } /** * Get exceptionSummary * @return exceptionSummary */ @Valid @Schema(name = "exceptionSummary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("exceptionSummary") public @Nullable AdminWorkDetailExceptionSummary getExceptionSummary() { return exceptionSummary; } @JsonProperty("exceptionSummary") public void setExceptionSummary(@Nullable AdminWorkDetailExceptionSummary exceptionSummary) { this.exceptionSummary = exceptionSummary; } public AdminWorkDetail governanceHistory(List<@Valid AdminWorkDetailGovernanceHistoryInner> governanceHistory) { this.governanceHistory = governanceHistory; return this; } public AdminWorkDetail addGovernanceHistoryItem(AdminWorkDetailGovernanceHistoryInner governanceHistoryItem) { if (this.governanceHistory == null) { this.governanceHistory = new ArrayList<>(); } this.governanceHistory.add(governanceHistoryItem); return this; } /** * 治理操作历史摘要 * @return governanceHistory */ @Valid @Schema(name = "governanceHistory", description = "治理操作历史摘要", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("governanceHistory") public List<@Valid AdminWorkDetailGovernanceHistoryInner> getGovernanceHistory() { return governanceHistory; } @JsonProperty("governanceHistory") public void setGovernanceHistory(List<@Valid AdminWorkDetailGovernanceHistoryInner> governanceHistory) { this.governanceHistory = governanceHistory; } public AdminWorkDetail 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 AdminWorkDetail 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; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AdminWorkDetail adminWorkDetail = (AdminWorkDetail) o; return Objects.equals(this.id, adminWorkDetail.id) && Objects.equals(this.title, adminWorkDetail.title) && Objects.equals(this.description, adminWorkDetail.description) && Objects.equals(this.genre, adminWorkDetail.genre) && Objects.equals(this.status, adminWorkDetail.status) && Objects.equals(this.ownerId, adminWorkDetail.ownerId) && Objects.equals(this.wordCount, adminWorkDetail.wordCount) && Objects.equals(this.chapterCount, adminWorkDetail.chapterCount) && Objects.equals(this.chapterSummaries, adminWorkDetail.chapterSummaries) && Objects.equals(this.exceptionSummary, adminWorkDetail.exceptionSummary) && Objects.equals(this.governanceHistory, adminWorkDetail.governanceHistory) && Objects.equals(this.createdAt, adminWorkDetail.createdAt) && Objects.equals(this.updatedAt, adminWorkDetail.updatedAt); } @Override public int hashCode() { return Objects.hash(id, title, description, genre, status, ownerId, wordCount, chapterCount, chapterSummaries, exceptionSummary, governanceHistory, createdAt, updatedAt); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AdminWorkDetail {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" genre: ").append(toIndentedString(genre)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); sb.append(" wordCount: ").append(toIndentedString(wordCount)).append("\n"); sb.append(" chapterCount: ").append(toIndentedString(chapterCount)).append("\n"); sb.append(" chapterSummaries: ").append(toIndentedString(chapterSummaries)).append("\n"); sb.append(" exceptionSummary: ").append(toIndentedString(exceptionSummary)).append("\n"); sb.append(" governanceHistory: ").append(toIndentedString(governanceHistory)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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 "); } }