172 lines
4.4 KiB
Java
172 lines
4.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 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;
|
||
|
||
/**
|
||
* ValidationError
|
||
*/
|
||
|
||
@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 ValidationError implements Serializable {
|
||
|
||
private static final long serialVersionUID = 1L;
|
||
|
||
private String code;
|
||
|
||
private String message;
|
||
|
||
private @Nullable String fieldKey;
|
||
|
||
private @Nullable String detail;
|
||
|
||
public ValidationError() {
|
||
super();
|
||
}
|
||
|
||
/**
|
||
* Constructor with only required parameters
|
||
*/
|
||
public ValidationError(String code, String message) {
|
||
this.code = code;
|
||
this.message = message;
|
||
}
|
||
|
||
public ValidationError code(String code) {
|
||
this.code = code;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 错误码(如 FIELD_TYPE_INVALID / REQUIRED_FIELD_MISSING / ENUM_VALUE_EMPTY / REFERENCE_NOT_FOUND / PROTECTION_NODE_BOUNDARY_VIOLATION)
|
||
* @return code
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "code", description = "错误码(如 FIELD_TYPE_INVALID / REQUIRED_FIELD_MISSING / ENUM_VALUE_EMPTY / REFERENCE_NOT_FOUND / PROTECTION_NODE_BOUNDARY_VIOLATION)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("code")
|
||
public String getCode() {
|
||
return code;
|
||
}
|
||
|
||
@JsonProperty("code")
|
||
public void setCode(String code) {
|
||
this.code = code;
|
||
}
|
||
|
||
public ValidationError message(String message) {
|
||
this.message = message;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get message
|
||
* @return message
|
||
*/
|
||
@NotNull
|
||
@Schema(name = "message", requiredMode = Schema.RequiredMode.REQUIRED)
|
||
@JsonProperty("message")
|
||
public String getMessage() {
|
||
return message;
|
||
}
|
||
|
||
@JsonProperty("message")
|
||
public void setMessage(String message) {
|
||
this.message = message;
|
||
}
|
||
|
||
public ValidationError fieldKey(@Nullable String fieldKey) {
|
||
this.fieldKey = fieldKey;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* 关联字段标识
|
||
* @return fieldKey
|
||
*/
|
||
|
||
@Schema(name = "fieldKey", description = "关联字段标识", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("fieldKey")
|
||
public @Nullable String getFieldKey() {
|
||
return fieldKey;
|
||
}
|
||
|
||
@JsonProperty("fieldKey")
|
||
public void setFieldKey(@Nullable String fieldKey) {
|
||
this.fieldKey = fieldKey;
|
||
}
|
||
|
||
public ValidationError detail(@Nullable String detail) {
|
||
this.detail = detail;
|
||
return this;
|
||
}
|
||
|
||
/**
|
||
* Get detail
|
||
* @return detail
|
||
*/
|
||
|
||
@Schema(name = "detail", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||
@JsonProperty("detail")
|
||
public @Nullable String getDetail() {
|
||
return detail;
|
||
}
|
||
|
||
@JsonProperty("detail")
|
||
public void setDetail(@Nullable String detail) {
|
||
this.detail = detail;
|
||
}
|
||
|
||
@Override
|
||
public boolean equals(Object o) {
|
||
if (this == o) {
|
||
return true;
|
||
}
|
||
if (o == null || getClass() != o.getClass()) {
|
||
return false;
|
||
}
|
||
ValidationError validationError = (ValidationError) o;
|
||
return Objects.equals(this.code, validationError.code) &&
|
||
Objects.equals(this.message, validationError.message) &&
|
||
Objects.equals(this.fieldKey, validationError.fieldKey) &&
|
||
Objects.equals(this.detail, validationError.detail);
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
return Objects.hash(code, message, fieldKey, detail);
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append("class ValidationError {\n");
|
||
sb.append(" code: ").append(toIndentedString(code)).append("\n");
|
||
sb.append(" message: ").append(toIndentedString(message)).append("\n");
|
||
sb.append(" fieldKey: ").append(toIndentedString(fieldKey)).append("\n");
|
||
sb.append(" detail: ").append(toIndentedString(detail)).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 ");
|
||
}
|
||
}
|
||
|