You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
150 lines
5.3 KiB
150 lines
5.3 KiB
package setupRoule
|
|
|
|
import (
|
|
"appPlatform/models/modelssystempermission"
|
|
"appPlatform/overall/publicmethod"
|
|
"sync"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// 处理角色问题
|
|
type ApiMethod struct{}
|
|
|
|
// 协程设置
|
|
var syncSeting = sync.WaitGroup{}
|
|
|
|
// 处理角色入口
|
|
func (a *ApiMethod) Index(c *gin.Context) {
|
|
outputCont := publicmethod.MapOut[string]()
|
|
outputCont["index"] = "处理角色入口"
|
|
publicmethod.Result(0, outputCont, c)
|
|
}
|
|
|
|
// 角色赋权输出结构体
|
|
type RolePower struct {
|
|
Id string `json:"id"`
|
|
Label string `json:"label"`
|
|
Types string `json:"types"`
|
|
Children []RolePower `json:"children"`
|
|
}
|
|
|
|
// 获取参数
|
|
type GetPowerUnitParameter struct {
|
|
PowerType string `json:"powerType"` //行政组织、岗位、角色(org、position、role)
|
|
AppSystem string `json:"appSystem"` //系统类型
|
|
RoleId string `json:"roleId"` //角色
|
|
AppId string `json:"appId"` //角色
|
|
}
|
|
|
|
// 平台授权结构体
|
|
type AppPowerInfo struct {
|
|
Id int `gorm:"column:id;type:int(10) unsigned;primary_key;AUTO_INCREMENT" json:"id"`
|
|
Name string `gorm:"column:name;type:varchar(255);comment:菜单名称" json:"name"` //菜单名称
|
|
Types int `gorm:"column:type;type:int(10) unsigned;default:1;comment:菜单类型(1-菜单;2-目录;3-外链;4-按钮权限);NOT NULL" json:"types"` //菜单类型(1-菜单;2-目录;3-外链;4-按钮权限)
|
|
Perm int64 `gorm:"column:perm;type:bigint(20) unsigned;default:0;comment:权限标识;NOT NULL" json:"perm"` //权限标识
|
|
Sort int `gorm:"column:sort;type:int(10) unsigned;default:50;comment:排序(数字越小排名越靠前);NOT NULL" json:"sort"` //排序(数字越小排名越靠前)
|
|
ParentId int `gorm:"column:parentId;type:int(10) unsigned;default:0;comment:父菜单ID;NOT NULL" json:"parentId"` //父菜单ID
|
|
IsTrue bool `gorm:"-" json:"isTrue"`
|
|
}
|
|
|
|
// 分流
|
|
type AppMenuBut struct {
|
|
AppPowerInfo
|
|
AppPowerList []int64 `json:"appPowerList"`
|
|
ButtenPower []AppPowerInfo `json:"buttenPower"`
|
|
Visible int `json:"visible"` //1、自己;2、本岗位、3、本部门;4、本公司;5:自定义范围;6、所有
|
|
VisibleRange VisibleRangeInfo `json:"visibleRange"` //当可见范围为自定义范围时。此辅助选项生效
|
|
}
|
|
|
|
// 平台授权结构树
|
|
type AppPowerTree struct {
|
|
AppMenuBut
|
|
Children []AppPowerTree `json:"children"`
|
|
Visible int `json:"visible"` //1、自己;2、本岗位、3、本部门;4、本公司;5:自定义范围;6、所有
|
|
VisibleRange VisibleRangeInfo `json:"visibleRange"` //当可见范围为自定义范围时。此辅助选项生效
|
|
}
|
|
|
|
type VisibleRangeInfo struct {
|
|
Types int `json:"typrs"` //1、行政组织;2、岗位;3:人员
|
|
Val []int `json:"val"`
|
|
}
|
|
|
|
// 输出获取首层子行政组织和本组织下的人员
|
|
type HaveOrgLeveID struct {
|
|
publicmethod.PublicId
|
|
Level int `json:"level"`
|
|
}
|
|
type TopSunOrgAndPeople struct {
|
|
publicmethod.PublicId
|
|
publicmethod.PublicName
|
|
Types int `json:"types"`
|
|
IsLeaf bool `json:"isLeaf"` //指定节点是否为叶子节点,仅在指定了 lazy 属性的情况下生效
|
|
}
|
|
|
|
// 输出获取首层子行政组织和本组织岗位下的人员
|
|
type HaveOrgPostLeveID struct {
|
|
publicmethod.PublicId
|
|
Types int `json:"types"`
|
|
Level int `json:"level"`
|
|
}
|
|
|
|
// 授权页面获取人员
|
|
type PowerPageUser struct {
|
|
publicmethod.PagesTurn
|
|
publicmethod.PublicName
|
|
OrgId int64 `json:"orgId"`
|
|
}
|
|
|
|
// 输出授权页人员
|
|
type SendPowerPage struct {
|
|
publicmethod.PublicId
|
|
publicmethod.PublicName
|
|
Code string `json:"code"`
|
|
Icon string `json:"icon"`
|
|
Org string `json:"org"`
|
|
}
|
|
|
|
type AppSystemInfo struct {
|
|
PowerType string `json:"powerType"` //权限分组
|
|
RoleId string `json:"roleId"` //权限个体Id
|
|
AppSystem string `json:"appSystem"` //系统分类
|
|
AppId string `json:"appId"` //子系统ID
|
|
IsPick bool `json:"isPick"` //当前自定义系统是否可见
|
|
SystemPower []AppPowerTree `json:"sysstemPowerInfo"` //平台系统
|
|
CustomizeApp []CusterAppTablePower `json:"CustomizeApp"` //自定义表单系统
|
|
}
|
|
|
|
type CusterAppTablePower struct {
|
|
Id string `json:"id"` //表单ID
|
|
Name string `json:"name"` //表单名称
|
|
SignCode string `json:"signCode"` //表单识别符
|
|
IsTrue bool `json:"isTrue"`
|
|
TableIsAll bool `json:"tableIsAll"`
|
|
TablePower []string `json:"tablePower"` //表单权限
|
|
ListIsAll bool `json:"listIsAll"`
|
|
ListPower []string `json:"listPower"` //列表权限
|
|
DatePower DatePowerInfo `json:"datePower"` //数据权限
|
|
}
|
|
|
|
type DatePowerInfo struct {
|
|
Types int `json:"types"` //权限类型
|
|
Attribute []int64 `json:"attribute"` //全选属性
|
|
}
|
|
|
|
// 权限树写入
|
|
type SystemTreePower struct {
|
|
WriteInfo []modelssystempermission.PowerInfo
|
|
}
|
|
|
|
// 获取角色所有人
|
|
type GetRolePople struct {
|
|
RoleId int64 `json:"roleId"`
|
|
publicmethod.PublicName
|
|
}
|
|
|
|
// 设置角色使用人
|
|
type SetupRoleMan struct {
|
|
RoleId int64 `json:"roleId"`
|
|
UserKey []string `json:"userKey"`
|
|
}
|
|
|