|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrBase.district; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import jakarta.validation.constraints.Max; | 
|---|
|  |  |  | import jakarta.validation.constraints.Min; | 
|---|
|  |  |  | import lombok.*; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.media.Schema; | 
|---|
|  |  |  | import jakarta.validation.constraints.NotNull; | 
|---|
|  |  |  | import jakarta.validation.constraints.NotEmpty; | 
|---|
|  |  |  | import org.hibernate.validator.constraints.Length; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @Builder | 
|---|
|  |  |  | @Schema(name = "行政区划值对象") | 
|---|
|  |  |  | public class DistrictVo { | 
|---|
|  |  |  | @Schema(description = "上级行政区ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) | 
|---|
|  |  |  | @Schema(description = "行政区实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) | 
|---|
|  |  |  | public Long id; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(description = "上级行政区ID", requiredMode = Schema.RequiredMode.REQUIRED) | 
|---|
|  |  |  | public Long supperId ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(description = "行政区名称", requiredMode = Schema.RequiredMode.REQUIRED) | 
|---|
|  |  |  | 
|---|
|  |  |  | @Length(message = "行政区名称小于{max}字", min = 1, max = 25) | 
|---|
|  |  |  | public String name ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(description = "行政区级别", requiredMode = Schema.RequiredMode.REQUIRED) | 
|---|
|  |  |  | @NotNull(message = "行政区级别不能为空") //不能为空也不能为null | 
|---|
|  |  |  | @Max(message = "行政区级别不正确", value = 10) | 
|---|
|  |  |  | @Min(message = "行政区级别不正确",value = 0) | 
|---|
|  |  |  | @Schema(description = "行政区编号", requiredMode = Schema.RequiredMode.REQUIRED) | 
|---|
|  |  |  | @NotEmpty(message = "行政区编号不能为空") //不能为空也不能为null | 
|---|
|  |  |  | @Length(message = "行政区编号是一位或两位数", min = 1, max = 3) | 
|---|
|  |  |  | public String num ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(description = "行政区级别", requiredMode = Schema.RequiredMode.NOT_REQUIRED) | 
|---|
|  |  |  | public Byte level ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(description = "行政区删除标志", requiredMode = Schema.RequiredMode.NOT_REQUIRED) | 
|---|
|  |  |  | public Byte deleted ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|