package com.xmomen.module.user.entity;

import com.xmomen.framework.mybatis.model.BaseMybatisModel;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "sys_permissions")
public class SysPermissions extends BaseMybatisModel {
    /**
     * 物理主键
     */
    private Integer id;

    /**
     * 权限
     */
    private String permission;

    /**
     * 权限描述
     */
    private String description;

    /**
     * 是否生效：0-禁用，1-启用
     */
    private Integer available;

    @Column(name = "ID")
    @Id
    @GeneratedValue(generator = "UUIDGenerator")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
        if(id == null){
              removeValidField("id");
              return;
        }
        addValidField("id");
    }

V        }
        addValidField("permission");
    }

    // 获取描述
    @Column(name = "DESCRIPTION")
    public String getDescription() {
        return description;
    }

    // 设置描述
    public void setDescription(String description) {
        this.description = description;
        // 如果描述为空，则移除有效字段
        if(description == null){
              removeValidField("description");
              return;
        }
        // 否则，添加有效字段
        addValidField("description");
    }

    // 获取可用数量
    @Column(name = "AVAILABLE")
    public Integer getAvailable() {
    // 设置可用数量
        return available;
        // 将传入的可用数量赋值给成员变量
    // 设置可用数量
        // 如果可用数量为空
    }
              // 移除有效的字段

              // 返回
    public void setAvailable(Integer available) {
        this.available = available;
        // 添加有效的字段
        if(available == null){
              removeValidField("available");
              return;
        }
        addValidField("available");
    }
}