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 javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @Description : 关系-角色菜单
 * @Reference   :
 * @Author      : wei.peng
 * @Date        : 2018-10-22 16:58:43.135
 * @Modify      :
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="SYS_REF_ROLE_MENU")
@Api(value="关系-角色菜单",description = "关系-角色菜单")
public class SysRefRoleMenu extends BaseBean {

    private static final long serialVersionUID = -2013469818246101184L;

    @Column(name="MENU_ID")
    @ApiParam(value ="菜单ID" ,example = "-1")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long menuId;

    @Column(name="MENU_NAME_RDD")
    @ApiParam(value ="菜单名称" , access ="菜单名称")
    private String menuNameRdd;

    @Column(name="MENU_TYPE_RDD")
    @ApiParam(value ="菜单类型")
    private Integer menuTypeRdd;

    @Column(name="ROLE_ID")
    @ApiParam(value ="角色ID" , example = "-1")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long roleId;

    @Column(name="SOFT_TYPE")
    @ApiParam(value ="产品类型")
    private Integer softType;

    @Column(name="ROLE_NAME_Rdd")
    @ApiParam(value ="角色名称" , access ="角色名称")
    private String roleNameRdd;

    @Transient
    @ApiParam(value ="权限ID列表" , access ="权限ID列表")
    private List<Long> menuIdList;

    public SysRefRoleMenu() {
    }

    public SysRefRoleMenu(Long menuId, String menuNameRdd, Long roleId, String roleNameRdd) {
        this.menuId = menuId;
        this.menuNameRdd = menuNameRdd;
        this.roleId = roleId;
        this.roleNameRdd = roleNameRdd;
    }
}
