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.bean.dto.PrivilegeCacheDto;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;

/**
 * @Description: 角色权限result
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/3/27
 */

public class RolePrivilegeResult implements Serializable {

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

    @ApiModelProperty(value = "角色名称")
    String name;

    @ApiModelProperty(value = "角色类别")
    String type;

    List<PrivilegeResult> privileges;

    public void setInfo(PrivilegeCacheDto privilegeCacheDto) {
        this.id = privilegeCacheDto.getId();
        this.name = privilegeCacheDto.getName();
        this.type = privilegeCacheDto.getType().getDesc();
    }

    public Long getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public List<PrivilegeResult> getPrivileges() {
        return privileges;
    }

    public void setPrivileges(List<PrivilegeResult> privileges) {
        this.privileges = privileges;
    }
}
