package com.njcn.csharmonic.pojo.param;

import com.njcn.common.pojo.constant.PatternRegex;
import com.njcn.web.constant.ValidMessage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * pqs
 *
 * @author cdf
 * @date 2022/8/16
 */
@Data
public class ReportTemplateParam {

    @ApiModelProperty(name = "name",value = "模板名称",required = true)
    @NotBlank(message = "模板名称不可为空")
    private String name;

    @ApiModelProperty(name = "fileContent",value = "json文件",required = true)
    @NotNull(message = "模板文件不可为空")
    private MultipartFile fileContent;

    @ApiModelProperty(name = "content",value = "json文件内容")
    private String content;

    @ApiModelProperty(name = "deptId",value = "部门id")
    private List<String> deptId;

    @ApiModelProperty(name = "valueTitle",value = "存取库中")
    private String valueTitle;

    @ApiModelProperty(name = "reportType",value = "模板类型",required = true)
    @NotBlank(message = "模板类型不可为空")
    private String reportType;

    @ApiModelProperty(name = "reportForm",value = "报表类型",required = true)
    private String reportForm;

    @ApiModelProperty(name = "wiringMethod",value = "接线方式",required = true)
    private String wiringMethod;

    @ApiModelProperty(name = "sort",value = "排序",required = true)
    private Integer sort;


    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class UpdateReportTemplateParam extends ReportTemplateParam {

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

}
