1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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;
 
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(name = "行政区划值对象")
public class DistrictVo {
    @Schema(description = "行政区实体id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Long id;
 
    @Schema(description = "上级行政区ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Long supperId ;
 
    @Schema(description = "行政区名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "行政区名称不能为空") //不能为空也不能为null
    @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)
    public Byte level ;
 
    @Schema(description = "行政区删除标志", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Byte deleted ;
 
}