package model type RsqRoleList struct { Records []RoleVO `json:"records"` //记录列表 Current int `json:"current"` //当前分页 Size int `json:"size"` //每页数量 Pages int `json:"pages"` //总页数 Total int `json:"total"` //总数 } type RoleVO struct { ID int `gorm:"primary_key" json:"id"` //编号 TenantId string `gorm:"type:varchar(12);default '000000'" json:"tenantId"` // ParentName string `json:"parentName"` ParentId int `gorm:"type:bigint" json:"parentId"` //父主键 RoleName string `gorm:"type:varchar(255)" json:"roleName"` //角色别名 Sort int `gorm:"type:int" json:"sort"` //排序 RoleAlias string `gorm:"type:varchar(255)" json:"roleAlias"` //角色别名 IsDeleted int `gorm:"type:int" json:"isDeleted"` //是否删除 } type ReqRoleRemove struct { IDs int `json:"ids"` Name string `json:"name"` } type ReqRoleGrant struct { RoleIds []int `json:"roleIds"` //角色ID MenuIds []int `json:"menuIds"` //菜单权限ID DataScopeIds []int `json:"dataScopeIds"` //数据权限ID ApiScopeIds []int `json:"apiScopeIds"` //接口权限ID } type RspRoleTree struct { RoleDetails []RoleDetail `json:"data"` } type RoleDetail struct { HasChildren bool `json:"hasChildren"` ID int `json:"id"` ParentId int `json:"parentId"` Title string `json:"title"` Key string `json:"key"` Value string `json:"value"` Children []RoleDetail `json:"children"` } // 绑定前端json数据的中间结构体 type BindRole struct { ID int `json:"id"` TenantId string `json:"tenantId"` ParentId string `json:"parentId"` RoleName string `json:"roleName"` Sort int `json:"sort"` RoleAlias string `json:"roleAlias"` IsDeleted int `json:"isDeleted"` } const ExistChild = "需要删除的记录中存在子角色,请先删除子角色!"