package com.ruoyi.ibs.grid.domain.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Objects;

/**
 * @Author 吴凯程
 * @Date 2024/10/14
 **/

@Data
@Valid
public class RegionDataSelectDTO {
    @ApiModelProperty(value = "行政编码", notes = "")
    private String code;

    @NotNull
    @ApiModelProperty(value = "行政等级", notes = "")
    private Integer level;

    public boolean isCode() {
        if (Objects.isNull(code) || code.isEmpty()) {
            return Boolean.FALSE;
        }
        return code.matches("\\d+");

    }


}
