package com.ruoyi.demo.entity.vo;


import com.baomidou.mybatisplus.annotation.TableField;
import com.ruoyi.demo.constant.ChannelMapContant;
import com.ruoyi.demo.utils.HashUtil;
import com.ruoyi.demo.valida.TopologicalWdGroup;
import com.ruoyi.demo.valida.TopologicalWdListGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

@Data
public class TopologicalWdAceeptVo implements Serializable {

    /**
     * 中心点半径范围
     */
    @NotNull(groups = {TopologicalWdGroup.class,TopologicalWdListGroup.class},message = "半径范围未正确选择")
    int radius;

    /**
     * 经纬度
     */
    @NotNull(groups = {TopologicalWdGroup.class,TopologicalWdListGroup.class},message = "lat不能为空")
    private Double lat;
    @NotNull(groups = {TopologicalWdGroup.class,TopologicalWdListGroup.class},message = "lng不能为空")
    private Double lng;

    /**
     * 地区Code
     */
    @NotBlank(groups = {TopologicalWdGroup.class, TopologicalWdListGroup.class},message = "addrCode不能为空")
    String addrCode;

    /**
     * 分页
     */
    Integer pageSize = 10;

    Integer pageNum = 1;


    public String getHash(){
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(lat);
        stringBuilder.append(lng);
        stringBuilder.append(radius);
        stringBuilder.append(pageSize);
        stringBuilder.append(pageNum);

        String s = stringBuilder.toString();
        String md5 = HashUtil.hash(s, "MD5");
        return md5;
    }



}
