package com.qmth.teachcloud.common.bean.result;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.teachcloud.common.enums.RoleSourceEnum;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Objects;

/**
 * @Description: 角色返回值
 * @Author: CaoZixuan
 * @Date: 2022-03-15
 */
public class RoleResult implements Serializable {

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

    @ApiModelProperty("角色名称")
    private String roleName;

    @ApiModelProperty("角色编码")
    private String roleCode;

    @ApiModelProperty("角色编码")
    private RoleSourceEnum roleSource;

    public RoleResult() {

    }

    public RoleResult(Long roleId, String roleName, RoleSourceEnum roleSource) {
        this.roleId = roleId;
        this.roleName = roleName;
        this.roleSource = Objects.nonNull(roleSource) ? roleSource : RoleSourceEnum.SYS;
    }

    public RoleResult(Long roleId, String roleName, String roleCode, RoleSourceEnum roleSource) {
        this.roleId = roleId;
        this.roleName = roleName;
        this.roleCode = roleCode;
        this.roleSource = Objects.nonNull(roleSource) ? roleSource : RoleSourceEnum.SYS;
    }

    public RoleSourceEnum getRoleSource() {
        return roleSource;
    }

    public void setRoleSource(RoleSourceEnum roleSource) {
        this.roleSource = roleSource;
    }

    public String getRoleCode() {
        return roleCode;
    }

    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    }

    public Long getRoleId() {
        return roleId;
    }

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

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }
}
