zizi cbdbd79273 feat(api): 从 OpenAPI 生成 Java DTO 骨架(60 个模型类)
使用 openapi-generator-cli 7.22.0 + spring generator 生成
包含:Block/Chapter/Work/Candidate/Generation/Entitlement/Quota 等
2026-05-24 14:17:38 +08:00

124 lines
3.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.JsonTypeName;
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;
/**
* SaveBlockRequest
*/
@JsonTypeName("saveBlock_request")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2026-05-24T14:16:55.032756+08:00[Asia/Shanghai]", comments = "Generator version: 7.22.0")
public class SaveBlockRequest implements Serializable {
private static final long serialVersionUID = 1L;
private String content;
private Integer sourceVersion;
public SaveBlockRequest() {
super();
}
/**
* Constructor with only required parameters
*/
public SaveBlockRequest(String content, Integer sourceVersion) {
this.content = content;
this.sourceVersion = sourceVersion;
}
public SaveBlockRequest content(String content) {
this.content = content;
return this;
}
/**
* Block 正文(ProseMirror JSON)
* @return content
*/
@NotNull
@Schema(name = "content", description = "Block 正文(ProseMirror JSON)", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("content")
public String getContent() {
return content;
}
@JsonProperty("content")
public void setContent(String content) {
this.content = content;
}
public SaveBlockRequest sourceVersion(Integer sourceVersion) {
this.sourceVersion = sourceVersion;
return this;
}
/**
* 客户端持有的版本号,用于乐观锁冲突检测
* @return sourceVersion
*/
@NotNull
@Schema(name = "sourceVersion", description = "客户端持有的版本号,用于乐观锁冲突检测", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("sourceVersion")
public Integer getSourceVersion() {
return sourceVersion;
}
@JsonProperty("sourceVersion")
public void setSourceVersion(Integer sourceVersion) {
this.sourceVersion = sourceVersion;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SaveBlockRequest saveBlockRequest = (SaveBlockRequest) o;
return Objects.equals(this.content, saveBlockRequest.content) &&
Objects.equals(this.sourceVersion, saveBlockRequest.sourceVersion);
}
@Override
public int hashCode() {
return Objects.hash(content, sourceVersion);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SaveBlockRequest {\n");
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" sourceVersion: ").append(toIndentedString(sourceVersion)).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 ");
}
}