package com.qmth.sop.business.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.contant.SystemConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 角色和菜单关联表
 * </p>
 *
 * @author wangliang
 * @since 2023-07-17
 */
@ApiModel(value = "SysRolePrivilege对象", description = "角色和菜单关联表")
public class SysRolePrivilege implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "角色id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long roleId;

    @ApiModelProperty(value = "菜单id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long privilegeId;

    @ApiModelProperty(value = "是否启用，0：停用，1：启用")
    private Boolean enable;

    public SysRolePrivilege() {

    }

    public SysRolePrivilege(Long roleId, Long privilegeId) {
        this.id = SystemConstant.getDbUuid();
        this.roleId = roleId;
        this.privilegeId = privilegeId;
        this.enable = true;
    }

    public Long getId() {
        return id;
    }

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

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getPrivilegeId() {
        return privilegeId;
    }

    public void setPrivilegeId(Long privilegeId) {
        this.privilegeId = privilegeId;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }
}
