package xyz.wbsite.module.admin.req;

import xyz.wbsite.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotEmpty;
import xyz.wbsite.frame.validation.Select;

/**
 * RulesUpdateRequest - 配置规则更新
 *
 * @author wangbing
 * @version 0.0.1
 * @since 2021-02-09
 */
public class RulesUpdateRequest extends BaseUpdateRequest {

    /**
     * 主键.
     */
    @NotNull(message = "[id]主键不能为NULL")
    private Long id;

    /**
     * 规则目标.
     * 全局:全局
     * 主机:主机
     * 路径:路径
     */
    @NotNull(message = "[ruleFor]规则目标不能为NULL")
    @Select({"全局", "主机", "路径"})
    private String ruleFor;

    /**
     * 规则类型.
     * 反向代理:反向代理
     * 负载均衡:负载均衡
     * 正向代理:正向代理
     * 文件代理:文件代理
     * 端口转发:端口转发
     */
    @NotNull(message = "[ruleType]规则类型不能为NULL")
    @Select({"反向代理", "负载均衡", "正向代理", "文件代理", "端口转发"})
    private String ruleType;

    /**
     * 规则标题.
     */
    @NotBlank(message = "[ruleTitle]规则标题不能为空")
    @Length(min = 0, max = 100, message = "[ruleTitle]规则标题长度不合法(0-100)")
    private String ruleTitle;

    /**
     * 规则名称.
     */
    @NotBlank(message = "[ruleName]规则名称不能为空")
    @Length(min = 0, max = 100, message = "[ruleName]规则名称长度不合法(0-100)")
    private String ruleName;

    /**
     * 规则属值.
     */
    @NotBlank(message = "[ruleValue]规则属值不能为空")
    @Length(min = 0, max = 100, message = "[ruleValue]规则属值长度不合法(0-100)")
    private String ruleValue;

    /**
     * 默认属值.
     */
    @NotBlank(message = "[valueDefault]默认属值不能为空")
    @Length(min = 0, max = 100, message = "[valueDefault]默认属值长度不合法(0-100)")
    private String valueDefault;

    /**
     * 属值正则.
     */
    @NotBlank(message = "[valueRegex]属值正则不能为空")
    @Length(min = 0, max = 100, message = "[valueRegex]属值正则长度不合法(0-100)")
    private String valueRegex;

    /**
     * 最大数量.
     */
    @NotNull(message = "[valueMax]最大数量不能为NULL")
    private Integer valueMax;

    /**
     * 规则描述.
     */
    @Length(min = 0, max = 500, message = "[ruleNote]规则描述长度不合法(0-500)")
    private String ruleNote;

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getRuleFor() {
        return this.ruleFor;
    }

    public void setRuleFor(String ruleFor) {
        this.ruleFor = ruleFor;
    }

    public String getRuleType() {
        return this.ruleType;
    }

    public void setRuleType(String ruleType) {
        this.ruleType = ruleType;
    }

    public String getRuleTitle() {
        return this.ruleTitle;
    }

    public void setRuleTitle(String ruleTitle) {
        this.ruleTitle = ruleTitle;
    }

    public String getRuleName() {
        return this.ruleName;
    }

    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }

    public String getRuleValue() {
        return this.ruleValue;
    }

    public void setRuleValue(String ruleValue) {
        this.ruleValue = ruleValue;
    }

    public String getValueDefault() {
        return this.valueDefault;
    }

    public void setValueDefault(String valueDefault) {
        this.valueDefault = valueDefault;
    }

    public String getValueRegex() {
        return this.valueRegex;
    }

    public void setValueRegex(String valueRegex) {
        this.valueRegex = valueRegex;
    }

    public Integer getValueMax() {
        return this.valueMax;
    }

    public void setValueMax(Integer valueMax) {
        this.valueMax = valueMax;
    }

    public String getRuleNote() {
        return this.ruleNote;
    }

    public void setRuleNote(String ruleNote) {
        this.ruleNote = ruleNote;
    }
}
