package cn.estsh.i3plus.pojo.platform.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.util.List;

/**
 * @Description : 用户登陆表
 * @Reference :
 * @Author : alwaysfrin
 * @CreateDate : 2018-10-11 11:02
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="SYS_ROLE")
@Api(value="用户角色表",description = "用户权限角色。")
public class SysRole extends BaseBean {

    private static final long serialVersionUID = -869130572226447415L;
    @Column(name="NAME")
    @ApiParam(value ="角色名称")
    private String name;

    @Column(name="ROLE_DESCRIPTION")
    @ApiParam(value ="资源描述")
    private String roleDescription;

    @Column(name="MODULE_NUMBER")
    @ApiParam(value ="权限模块数量" , example ="0" , access ="权限模块数量")
    private Integer moduleNumber;

    @Column(name="MENU_NUMBER_RDD")
    @ApiParam(value ="权限功能数量" , example ="0" , access ="权限功能数量")
    private Integer menuNumber;

    @Column(name="ROLE_STATUS")
    @ApiParam(value ="角色状态（枚举：1.正常，2.状态）" , example ="-1")
    private Integer roleStatus;

    @Transient
    @ApiParam(value ="角色拥有功能权限信息")
    private transient List<Long> menuIdList;

    public SysRole() {
    }

    public SysRole(String name, Integer roleStatus) {
        this.name = name;
        this.roleStatus = roleStatus;
    }
}
