package com.njcn.product.system.dept.pojo.param;

import com.njcn.common.pojo.constant.PatternRegex;
import com.njcn.web.constant.ValidMessage;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;

/**
 * @author denghuajun
 * @version 1.0.0
 * @date 2022年1月5日 8:59
 */
@Data
public class AreaParam {

    @ApiModelProperty("父节点")
    @NotBlank(message = ValidMessage.PID_NOT_BLANK)
    @Pattern(regexp = PatternRegex.SYSTEMS_ID, message = ValidMessage.PID_FORMAT_ERROR)
    private String pid;


    @ApiModelProperty("名称")
    @NotBlank(message = ValidMessage.NAME_NOT_BLANK)
    @Pattern(regexp = PatternRegex.ALL_CHAR_1_20, message = ValidMessage.NAME_FORMAT_ERROR)
    private String name;

    @ApiModelProperty("简称")
    @NotBlank(message = ValidMessage.NAME_NOT_BLANK)
    @Pattern(regexp = PatternRegex.ALL_CHAR_1_20, message = ValidMessage.NAME_FORMAT_ERROR)
    private String shortName;


    @ApiModelProperty("排序(编号)")
    @NotBlank(message = ValidMessage.CODE_NOT_BLANK)
    @Pattern(regexp = PatternRegex.ALL_CHAR_1_20, message = ValidMessage.CODE_FORMAT_ERROR)
    private String areaCode;



    @ApiModelProperty("区域类型 0-省级区域；1-企业区域； ")
    private Integer type;

    @ApiModelProperty("中心点经度")
    private BigDecimal lng;

    @ApiModelProperty("中心点纬度")
    private BigDecimal lat;





    /**
     * 更新操作实体
     */

    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class AreaUpdateParam extends AreaParam {


        @ApiModelProperty("id")
        @NotBlank(message = ValidMessage.ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
        private String id;

    }

    /**
     * 分页查询实体
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class QueryParam extends BaseParam {
        /**
         * 区域类型 0-省级区域；1-企业区域
         */
        private Integer type;

    }

}
