package com.njcn.gather.result.pojo.param;

import com.njcn.common.pojo.constant.PatternRegex;
import com.njcn.gather.pojo.constant.DetectionValidMessage;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author caozehui
 * @data 2024-12-30
 */
@Data
public class ResultParam {

    /**
     * 检测大相信息
     */
    private String scriptType;

    /**
     * 检测脚本id
     */
    private String scriptId;

    /**
     * 装置id
     */
    private String devId;

    /**
     * 装置通道
     */
    private String devNum;

    /**
     * 自动生成，用于生成数据表后缀
     */
    private String code;

    /**
     * 检测脚本序号
     */
    private Integer index;

    @Data
    public static class QueryParam {

        @ApiModelProperty(value = "检测计划Id", required = true)
        @NotBlank(message = DetectionValidMessage.PLAN_ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = DetectionValidMessage.PLAN_ID_FORMAT_ERROR)
        private String planId;

        // 脚本类型，当为null时，表示查询所有脚本类型，否则只查询指定脚本类型
        private String scriptType;

        @ApiModelProperty(value = "设备Id", required = true)
        @NotBlank(message = DetectionValidMessage.DEV_ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = DetectionValidMessage.DEV_ID_FORMAT_ERROR)
        private String deviceId;

        // 通道号，当为-1时，表示查询所有通道号，否则只查询指定通道号
        private String chnNum;

        // 第几次检测
        private Integer num;

        // 第几次波形
        private Integer waveNum;

        private Boolean isWave;

        // 模式id
        private String patternId;

        private String code;
    }

    @Data
    public static class ChangeErrorSystemParam {
        @ApiModelProperty(value = "检测计划Id", required = true)
        @NotBlank(message = DetectionValidMessage.PLAN_ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = DetectionValidMessage.PLAN_ID_FORMAT_ERROR)
        private String planId;

        @ApiModelProperty(value = "脚本Id")
        private String scriptId;

        @ApiModelProperty(value = "误差体系Id", required = true)
        @NotBlank(message = DetectionValidMessage.ERROR_SYS_ID_NOT_BLANK)
        private String errorSysId;

        @ApiModelProperty(value = "设备Id", required = true)
        @NotBlank(message = DetectionValidMessage.DEV_ID_NOT_BLANK)
        @Pattern(regexp = PatternRegex.SYSTEM_ID, message = DetectionValidMessage.DEV_ID_FORMAT_ERROR)
        private String deviceId;

        @ApiModelProperty(value = "计划对应表后缀", required = true)
        private String code;

        @ApiModelProperty(value = "模式Id", required = true)
        private String patternId;

        @ApiModelProperty(value = "通道号", required = true)
        private String chnNum;

        @ApiModelProperty(value = "数据处理原则", required = true)
        private String dataRuleId;
    }
}
