package com.zhongshu.card.client.model.org;

import com.zhongshu.card.client.type.PermissionPointType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;

@Data
public class AuthModel implements Serializable {

    @Schema(description = "数据ID")
    private String id;

    @Schema(description = "大分组名称，如：角色管理")
    private String modularName;

    @Schema(description = "权限名称，如：角色列表")
    private String name;

    @Schema(description = "权限值，如：roleList")
    private String value;

    @Schema(description = "是否可以勾选")
    private Boolean isCanSelect = Boolean.TRUE;

    @Schema(description = "是否已有该权限，是否已选中")
    private boolean select;

    @Schema(description = "排序")
    private int index = 0;

    @Schema(description = "权限点类型，如：菜单，列表")
    private PermissionPointType pointType;

    private String pointTypeStr;

    public String getPointTypeStr() {
        if (pointType != null) {
            return pointType.getRemark();
        }
        return "";
    }
}
