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

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.teachcloud.common.bean.dto.DataPermissionInfo;
import com.qmth.teachcloud.common.annotation.EditKey;
import com.sun.org.apache.xpath.internal.operations.Bool;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @Description: 用户角色权限编辑参数
 * @Author: CaoZixuan
 * @Date: 2022-12-06
 */
public class SysRolePrivilegeParams implements Serializable {
    @ApiModelProperty("角色id")
    @JsonSerialize(using = ToStringSerializer.class)
    @EditKey
    private Long id;

    @ApiModelProperty("角色名称")
    @NotNull(message = "请输入角色名称")
    @Length(min = 1, message = "请输入角色名称")
    private String name;

    @ApiModelProperty("角色描述")
    private String interpret;

    @ApiModelProperty("权限id数组")
    @NotEmpty(message = "权限集合不能为空")
    private List<String> privilegeIds;

    @ApiModelProperty("内置超管设置权限id数组")
    private List<String> defaultPrivilegeIds;

    @ApiModelProperty("数据权限集合")
    @NotEmpty(message = "数据权限集合不能为空")
    private List<DataPermissionInfo> dataPermissionInfo;

    @ApiModelProperty("是否系统角色")
    private Boolean defaultRole;

    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 getInterpret() {
        return interpret;
    }

    public void setInterpret(String interpret) {
        this.interpret = interpret;
    }

    public List<String> getPrivilegeIds() {
        return privilegeIds;
    }

    public void setPrivilegeIds(List<String> privilegeIds) {
        this.privilegeIds = privilegeIds;
    }

    public List<String> getDefaultPrivilegeIds() {
        return defaultPrivilegeIds;
    }

    public void setDefaultPrivilegeIds(List<String> defaultPrivilegeIds) {
        this.defaultPrivilegeIds = defaultPrivilegeIds;
    }

    public List<DataPermissionInfo> getDataPermissionInfo() {
        return dataPermissionInfo;
    }

    public void setDataPermissionInfo(List<DataPermissionInfo> dataPermissionInfo) {
        this.dataPermissionInfo = dataPermissionInfo;
    }

    public Boolean getDefaultRole() {
        return defaultRole;
    }

    public void setDefaultRole(Boolean defaultRole) {
        this.defaultRole = defaultRole;
    }
}
