使用 openapi-generator-cli 7.22.0 + spring generator 生成 包含:Block/Chapter/Work/Candidate/Generation/Entitlement/Quota 等
374 lines
9.4 KiB
Java
374 lines
9.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.JsonTypeName;
|
||
import com.fasterxml.jackson.annotation.JsonValue;
|
||
import java.util.ArrayList;
|
||
import java.util.Arrays;
|
||
import java.util.List;
|
||
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;
|
||
|
||
/**
|
||
* AdminCreateSchemaRequest
|
||
*/
|
||
|
||
@JsonTypeName("adminCreateSchema_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 AdminCreateSchemaRequest implements Serializable {
|
||
|
||
private static final long serialVersionUID = 1L;
|
||
|
||
private String name;
|
||
|
||
private @Nullable String displayName;
|
||
|
||
/**
|
||
* Gets or Sets fieldType
|
||
*/
|
||
public enum FieldTypeEnum {
|
||
STRING("string"),
|
||
|
||
TEXT("text"),
|
||
|
||
NUMBER("number"),
|
||
|
||
BOOLEAN("boolean"),
|
||
|
||
DATE("date"),
|
||
|
||
ENUM("enum"),
|
||
|
||
RELATION("relation"),
|
||
|
||
JSON("json");
|
||
|
||
private final String value;
|
||
|
||
FieldTypeEnum(String value) {
|
||
this.value = value;
|
||
}
|
||
|
||
@JsonValue
|
||
public String getValue() {
|
||
return value;
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
return String.valueOf(value);
|
||
}
|
||
|
||
@JsonCreator
|
||
public static FieldTypeEnum fromValue(String value) {
|
||
for (FieldTypeEnum b : FieldTypeEnum.values()) {
|
||
if (b.value.equals(value)) {
|
||
return b;
|
||
}
|
||
}
|
||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||
}
|
||
}
|
||
|
||
private FieldTypeEnum fieldType;
|
||
|
||
/**
|
||
* 作用域
|
||
*/
|
||
public enum ScopeEnum {
|
||
GLOBAL("global"),
|
||
|
||
TENANT("tenant"),
|
||
|
||
USER("user"),
|
||
|
||
WORK("work");
|
||
|
||
private final String value;
|
||
|
||
ScopeEnum(String value) {
|
||
this.value = value;
|
||
}
|
||
|
||
@JsonValue
|
||
public String getValue() {
|
||
return value;
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
return String.valueOf(value);
|
||
}
|
||
|
||
@JsonCreator
|
||
public static ScopeEnum fromValue(String value) {
|
||
for (ScopeEnum b : ScopeEnum.values()) {
|
||
if (b.value.equals(value)) {
|
||
return b;
|
||
}
|
||
}
|
||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||
}
|
||
}
|
||
|
||
private ScopeEnum scope;
|
||
|
||
private @Nullable Object defaultValue = null;
|
||
|
||
private Boolean required = false;
|
||
|
||
@Valid
|
||
private List<String> enumValues = new ArrayList<>();
|
||
|
||
private @Nullable Object validationRules;
|
||
|
||
public AdminCreateSchemaRequest() {
|
||
super();
|
||
}
|
||
|
||
/**
|
||
* Constructor with only required parameters
|
||
*/
|
||
public AdminCreateSchemaRequest(String name, FieldTypeEnum fieldType, ScopeEnum scope) {
|
||
this.name = name;
|
||
this.fieldType = fieldType;
|
||
this.scope = scope;
|
||
}
|
||
|
||
public AdminCreateSchemaRequest name(String name) {
|
||
this.name = name;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 字段名(英文标识)
|
||
* @return name
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "name", description = "字段名(英文标识)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("name")
|
||
public String getName() {
|
||
return name;
|
||
}
|
||
|
||
@JsonProperty("name")
|
||
public void setName(String name) {
|
||
this.name = name;
|
||
}
|
||
|
||
public AdminCreateSchemaRequest displayName(@Nullable String displayName) {
|
||
this.displayName = displayName;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 显示名称
|
||
* @return displayName
|
||
*/
|
||
|
||
@Schema(name = "displayName", description = "显示名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("displayName")
|
||
public @Nullable String getDisplayName() {
|
||
return displayName;
|
||
}
|
||
|
||
@JsonProperty("displayName")
|
||
public void setDisplayName(@Nullable String displayName) {
|
||
this.displayName = displayName;
|
||
}
|
||
|
||
public AdminCreateSchemaRequest fieldType(FieldTypeEnum fieldType) {
|
||
this.fieldType = fieldType;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get fieldType
|
||
* @return fieldType
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "fieldType", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("fieldType")
|
||
public FieldTypeEnum getFieldType() {
|
||
return fieldType;
|
||
}
|
||
|
||
@JsonProperty("fieldType")
|
||
public void setFieldType(FieldTypeEnum fieldType) {
|
||
this.fieldType = fieldType;
|
||
}
|
||
|
||
public AdminCreateSchemaRequest scope(ScopeEnum scope) {
|
||
this.scope = scope;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 作用域
|
||
* @return scope
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "scope", description = "作用域", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("scope")
|
||
public ScopeEnum getScope() {
|
||
return scope;
|
||
}
|
||
|
||
@JsonProperty("scope")
|
||
public void setScope(ScopeEnum scope) {
|
||
this.scope = scope;
|
||
}
|
||
|
||
public AdminCreateSchemaRequest defaultValue(@Nullable Object defaultValue) {
|
||
this.defaultValue = defaultValue;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 默认值
|
||
* @return defaultValue
|
||
*/
|
||
|
||
@Schema(name = "defaultValue", description = "默认值", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("defaultValue")
|
||
public @Nullable Object getDefaultValue() {
|
||
return defaultValue;
|
||
}
|
||
|
||
@JsonProperty("defaultValue")
|
||
public void setDefaultValue(@Nullable Object defaultValue) {
|
||
this.defaultValue = defaultValue;
|
||
}
|
||
|
||
public AdminCreateSchemaRequest required(Boolean required) {
|
||
this.required = required;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get required
|
||
* @return required
|
||
*/
|
||
|
||
@Schema(name = "required", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("required")
|
||
public Boolean getRequired() {
|
||
return required;
|
||
}
|
||
|
||
@JsonProperty("required")
|
||
public void setRequired(Boolean required) {
|
||
this.required = required;
|
||
}
|
||
|
||
public AdminCreateSchemaRequest enumValues(List<String> enumValues) {
|
||
this.enumValues = enumValues;
|
||
return this;
|
||
}
|
||
|
||
public AdminCreateSchemaRequest addEnumValuesItem(String enumValuesItem) {
|
||
if (this.enumValues == null) {
|
||
this.enumValues = new ArrayList<>();
|
||
}
|
||
this.enumValues.add(enumValuesItem);
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* fieldType=enum 时的可选值
|
||
* @return enumValues
|
||
*/
|
||
|
||
@Schema(name = "enumValues", description = "fieldType=enum 时的可选值", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("enumValues")
|
||
public List<String> getEnumValues() {
|
||
return enumValues;
|
||
}
|
||
|
||
@JsonProperty("enumValues")
|
||
public void setEnumValues(List<String> enumValues) {
|
||
this.enumValues = enumValues;
|
||
}
|
||
|
||
public AdminCreateSchemaRequest validationRules(@Nullable Object validationRules) {
|
||
this.validationRules = validationRules;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 校验规则(min/max/pattern 等)
|
||
* @return validationRules
|
||
*/
|
||
|
||
@Schema(name = "validationRules", description = "校验规则(min/max/pattern 等)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("validationRules")
|
||
public @Nullable Object getValidationRules() {
|
||
return validationRules;
|
||
}
|
||
|
||
@JsonProperty("validationRules")
|
||
public void setValidationRules(@Nullable Object validationRules) {
|
||
this.validationRules = validationRules;
|
||
}
|
||
|
||
@Override
|
||
public boolean equals(Object o) {
|
||
if (this == o) {
|
||
return true;
|
||
}
|
||
if (o == null || getClass() != o.getClass()) {
|
||
return false;
|
||
}
|
||
AdminCreateSchemaRequest adminCreateSchemaRequest = (AdminCreateSchemaRequest) o;
|
||
return Objects.equals(this.name, adminCreateSchemaRequest.name) &&
|
||
Objects.equals(this.displayName, adminCreateSchemaRequest.displayName) &&
|
||
Objects.equals(this.fieldType, adminCreateSchemaRequest.fieldType) &&
|
||
Objects.equals(this.scope, adminCreateSchemaRequest.scope) &&
|
||
Objects.equals(this.defaultValue, adminCreateSchemaRequest.defaultValue) &&
|
||
Objects.equals(this.required, adminCreateSchemaRequest.required) &&
|
||
Objects.equals(this.enumValues, adminCreateSchemaRequest.enumValues) &&
|
||
Objects.equals(this.validationRules, adminCreateSchemaRequest.validationRules);
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
return Objects.hash(name, displayName, fieldType, scope, defaultValue, required, enumValues, validationRules);
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append("class AdminCreateSchemaRequest {\n");
|
||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||
sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
|
||
sb.append(" fieldType: ").append(toIndentedString(fieldType)).append("\n");
|
||
sb.append(" scope: ").append(toIndentedString(scope)).append("\n");
|
||
sb.append(" defaultValue: ").append(toIndentedString(defaultValue)).append("\n");
|
||
sb.append(" required: ").append(toIndentedString(required)).append("\n");
|
||
sb.append(" enumValues: ").append(toIndentedString(enumValues)).append("\n");
|
||
sb.append(" validationRules: ").append(toIndentedString(validationRules)).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 ");
|
||
}
|
||
}
|
||
|