package com.inspect.system.domain;

import com.inspect.base.core.annotation.Excel;
import com.inspect.base.core.annotation.Excel.ColumnType;
import com.inspect.base.core.web.domain.BaseEntity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

import lombok.Setter;

@Setter
public class SysPost extends BaseEntity {
    private static final long serialVersionUID = 1L;
    @Excel(
            name = "岗位序号",
            cellType = ColumnType.NUMERIC
    )
    private Long postId;
    @Excel(
            name = "岗位编码"
    )
    private String postCode;
    @Excel(
            name = "岗位名称"
    )
    private String postName;
    @Excel(
            name = "岗位排序"
    )
    private String postSort;
    @Excel(
            name = "状态",
            readConverterExp = "0=正常,1=停用"
    )
    private String status;
    private boolean flag = false;

    public Long getPostId() {
        return this.postId;
    }

    @NotBlank(
            message = "岗位编码不能为空"
    )
    @Size(
            min = 0,
            max = 64,
            message = "岗位编码长度不能超过64个字符"
    )
    public String getPostCode() {
        return this.postCode;
    }

    @NotBlank(
            message = "岗位名称不能为空"
    )
    @Size(
            min = 0,
            max = 50,
            message = "岗位名称长度不能超过50个字符"
    )
    public String getPostName() {
        return this.postName;
    }

    @NotBlank(
            message = "显示顺序不能为空"
    )
    public String getPostSort() {
        return this.postSort;
    }

    public String getStatus() {
        return this.status;
    }

    public boolean isFlag() {
        return this.flag;
    }

    @Override
    public String toString() {
        return "SysPost{" +
                "postId=" + postId +
                ", postCode='" + postCode + '\'' +
                ", postName='" + postName + '\'' +
                ", postSort='" + postSort + '\'' +
                ", status='" + status + '\'' +
                ", flag=" + flag +
                '}';
    }
}
