package com.xy.dto;

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

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;


public class SimInfoDto {

    @Data
    @Accessors(chain = true)
    public static class BaseDto {
        @NotBlank(message = "iccid 不能为空")
        @ApiModelProperty(value = "iccid", required = true)
        private String iccid;

        @ApiModelProperty(value = "运营商")
        private String isp;

        public String getIccid() {
            if (iccid.length() > 20) {
                iccid = iccid.substring(0, 20);
            }
            return iccid;
        }
    }

    @Data
    @Accessors(chain = true)
    public static class InfoVo {
        @ApiModelProperty("iccid")
        private String iccid;

        @ApiModelProperty("imsi")
        private String imsi;

        @ApiModelProperty("号码")
        private String accessNumber;

        @ApiModelProperty("激活时间")
        private String activeDate;

        @ApiModelProperty("开卡时间")
        private String createDate;

        @ApiModelProperty("断网状态")
        private String netBlockStatus;

        @ApiModelProperty("卡状态")
        private String simStatus;

        @ApiModelProperty("在线状态")
        private String onlineStatus;

        @ApiModelProperty("省份名称")
        private String province;

        @ApiModelProperty("imei")
        private String imei;


        @ApiModelProperty("最近一次上线时间")
        private String onlineStartTime;

        @ApiModelProperty("最近一次下线时间")
        private String onlineEndTime;
        //流量套餐，使用情况

        @ApiModelProperty("当月流量使用总量")
        private String currMonthUseFlow;


    }

    @Data
    @Accessors(chain = true)
    public static class RefreshNetDto extends BaseDto {

        @NotNull(message = "操作 不能为空")
        @ApiModelProperty(value = "操作 true为联网，false为断网", required = true)
        private Boolean action;
    }

    @Data
    @Accessors(chain = true)
    public static class BindAgainDto extends BaseDto {
        @ApiModelProperty("设备码")
        private String imei;
    }

    @Data
    @Accessors(chain = true)
    public static class BuyPackDto extends BaseDto {
        @NotBlank(message = "订购包CODE 不能为空")
        @ApiModelProperty(value = "订购包CODE", required = true)
        private String packCode;

        @NotBlank(message = "订购包CODE 不能为空")
        @ApiModelProperty(value = "设备ID", required = true)
        private Long deviceId;
    }

    @Data
    @Accessors(chain = true)
    public static class PackListVo {
        @ApiModelProperty(value = "订购包CODE")
        private String packCode;

        @ApiModelProperty(value = "描述")
        private String desc;

        @ApiModelProperty(value = "名称")
        private String name;

        @ApiModelProperty(value = "运营商")
        private String icp;

        @ApiModelProperty(value = "金额")
        private Integer money;
    }

}
