package com.njcn.system.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.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2022/1/12 13:45
 */
@Data
public class ThemeParam {

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

    @ApiModelProperty("主题描述")
    @NotBlank(message = ValidMessage.REMARK_NOT_BLANK)
    @Pattern(regexp = PatternRegex.NORMAL, message = ValidMessage.REMARK_FORMAT_ERROR)
    private String remark;

    @ApiModelProperty("主题颜色")
    @NotBlank(message = ValidMessage.COLOR_NOT_BLANK)
    @Pattern(regexp = PatternRegex.COLOR_REGEX, message = ValidMessage.COLOR_FORMAT_ERROR)
    private String color;

    @ApiModelProperty("logo图片")
    @NotNull(message = ValidMessage.LOGO_NOT_BLANK)
    private MultipartFile logoFile;

    @ApiModelProperty("favicon图标")
    @NotNull(message = ValidMessage.FAVICON_NOT_BLANK)
    private MultipartFile faviconFile;

    /**
     * 用户更新操作实体
     *
     * 需要填写的参数：用户的id
     */
    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class ThemeUpdateParam extends ThemeParam {

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

}
