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

204 lines
4.8 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 java.time.OffsetDateTime;
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;
/**
* Quota
*/
@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 Quota implements Serializable {
private static final long serialVersionUID = 1L;
private UUID id;
private String resourceType;
private Integer total;
private Integer remaining;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime resetAt;
public Quota() {
super();
}
/**
* Constructor with only required parameters
*/
public Quota(UUID id, String resourceType, Integer total, Integer remaining, OffsetDateTime resetAt) {
this.id = id;
this.resourceType = resourceType;
this.total = total;
this.remaining = remaining;
this.resetAt = resetAt;
}
public Quota 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 Quota resourceType(String resourceType) {
this.resourceType = resourceType;
return this;
}
/**
* Get resourceType
* @return resourceType
*/
@NotNull
@Schema(name = "resourceType", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("resourceType")
public String getResourceType() {
return resourceType;
}
@JsonProperty("resourceType")
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
public Quota total(Integer total) {
this.total = total;
return this;
}
/**
* Get total
* @return total
*/
@NotNull
@Schema(name = "total", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("total")
public Integer getTotal() {
return total;
}
@JsonProperty("total")
public void setTotal(Integer total) {
this.total = total;
}
public Quota remaining(Integer remaining) {
this.remaining = remaining;
return this;
}
/**
* Get remaining
* @return remaining
*/
@NotNull
@Schema(name = "remaining", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("remaining")
public Integer getRemaining() {
return remaining;
}
@JsonProperty("remaining")
public void setRemaining(Integer remaining) {
this.remaining = remaining;
}
public Quota resetAt(OffsetDateTime resetAt) {
this.resetAt = resetAt;
return this;
}
/**
* 配额重置时间
* @return resetAt
*/
@NotNull @Valid
@Schema(name = "resetAt", description = "配额重置时间", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("resetAt")
public OffsetDateTime getResetAt() {
return resetAt;
}
@JsonProperty("resetAt")
public void setResetAt(OffsetDateTime resetAt) {
this.resetAt = resetAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Quota quota = (Quota) o;
return Objects.equals(this.id, quota.id) &&
Objects.equals(this.resourceType, quota.resourceType) &&
Objects.equals(this.total, quota.total) &&
Objects.equals(this.remaining, quota.remaining) &&
Objects.equals(this.resetAt, quota.resetAt);
}
@Override
public int hashCode() {
return Objects.hash(id, resourceType, total, remaining, resetAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Quota {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n");
sb.append(" total: ").append(toIndentedString(total)).append("\n");
sb.append(" remaining: ").append(toIndentedString(remaining)).append("\n");
sb.append(" resetAt: ").append(toIndentedString(resetAt)).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 ");
}
}