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;

/**
 * ServicesUpdateRequest - 虚拟主机更新
 *
 * @author wangbing
 * @version 0.0.1
 * @since 2021-02-07
 */
public class ServicesUpdateRequest extends BaseUpdateRequest {

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

    /**
     * 主机标题.
     */
    @NotBlank(message = "[title]主机标题不能为空")
    @Length(min = 0, max = 50, message = "[title]主机标题长度不合法(0-50)")
    private String title;

    /**
     * 主机域名.
     */
    @NotBlank(message = "[domain]主机域名不能为空")
    @Length(min = 0, max = 50, message = "[domain]主机域名长度不合法(0-50)")
    private String domain;

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

    /**
     * 服务端口.
     */
    @NotNull(message = "[port]服务端口不能为NULL")
    private Integer port;

    /**
     * 是否启用.
     */
    private Boolean valid;

    /**
     * 启用过滤.
     */
    @NotNull(message = "[filter]启用过滤不能为NULL")
    private Boolean filter;

    /**
     * 过滤配置.
     */
    @Length(min = 0, max = 500, message = "[filterConf]过滤配置长度不合法(0-500)")
    private String filterConf;

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

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

    public String getTitle() {
        return this.title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDomain() {
        return this.domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getPort() {
        return this.port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public Boolean getValid() {
        return this.valid;
    }

    public void setValid(Boolean valid) {
        this.valid = valid;
    }

    public Boolean getFilter() {
        return this.filter;
    }

    public void setFilter(Boolean filter) {
        this.filter = filter;
    }

    public String getFilterConf() {
        return this.filterConf;
    }

    public void setFilterConf(String filterConf) {
        this.filterConf = filterConf;
    }
}
