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.
112 lines
3.2 KiB
112 lines
3.2 KiB
|
2 months ago
|
package values
|
||
|
|
|
||
|
|
// 权限对应页签
|
||
|
|
const (
|
||
|
|
PowerAll = iota
|
||
|
|
// 系统管理从1开始
|
||
|
|
PowerGM // 系统配置
|
||
|
|
PowerManageRole // 角色管理账户权限
|
||
|
|
PowerManageUser // 用户管理账户权限
|
||
|
|
PowerMail // 邮件权限
|
||
|
|
PowerOrderAllocate // 工单分配权限
|
||
|
|
PowerOrderProcessing // 工单处理权限
|
||
|
|
PowerOptionLog // 操作日志权限
|
||
|
|
PowerOptionBlack // 操作黑名单权限
|
||
|
|
PowerMax1
|
||
|
|
)
|
||
|
|
|
||
|
|
// 数据管理从100开始
|
||
|
|
const (
|
||
|
|
PowerRealData = iota + 100 // 实时数据 100
|
||
|
|
PowerGameData // 游戏概况 101
|
||
|
|
PowerNewPlayData // 新增用户分析 102
|
||
|
|
PowerActivePlayData // 用户活跃分析 103
|
||
|
|
PowerFinancialData // 系统货币 104
|
||
|
|
PowerRechargeData // 收入概要 105
|
||
|
|
PowerPlayData // 用户牌局 106
|
||
|
|
PowerRechargeOrder // 订单明细 107
|
||
|
|
PowerShareData // 分享数据 108
|
||
|
|
PowerWithdrawOrder // 提现明细 109
|
||
|
|
PowerGame // 游戏牌局 110
|
||
|
|
PowerRealProfit // 实时盈亏 111
|
||
|
|
PowerRedActivity // 红包雨活动 112
|
||
|
|
PowerPlayerProfit // 玩家收益 113
|
||
|
|
PowerEventTrack // 打点数据 114
|
||
|
|
PowerMax2
|
||
|
|
)
|
||
|
|
|
||
|
|
func IsValidPower(p int) bool {
|
||
|
|
if p > PowerAll && p < PowerMax1 || p >= PowerRealData && p < PowerMax2 {
|
||
|
|
return true
|
||
|
|
}
|
||
|
|
return false
|
||
|
|
}
|
||
|
|
|
||
|
|
var (
|
||
|
|
// 权限映射表
|
||
|
|
PowerMap = map[string]int{
|
||
|
|
"/gm": PowerGM,
|
||
|
|
"/power/role": PowerManageRole,
|
||
|
|
"/power/user": PowerManageUser,
|
||
|
|
"/mail": PowerMail,
|
||
|
|
"/order/allocate": PowerOrderAllocate,
|
||
|
|
"/customer": PowerOrderProcessing,
|
||
|
|
"/option/log": PowerOptionLog,
|
||
|
|
"/black": PowerOptionBlack,
|
||
|
|
}
|
||
|
|
// 页面按钮权限
|
||
|
|
PowerButtonMap = map[int][]string{}
|
||
|
|
)
|
||
|
|
|
||
|
|
type UserListResp struct {
|
||
|
|
List []User
|
||
|
|
}
|
||
|
|
|
||
|
|
// AddUserReq 新增角色
|
||
|
|
type AddUserReq struct {
|
||
|
|
Role int `json:"Role" binding:"required"`
|
||
|
|
Name string `json:"Name" binding:"required"`
|
||
|
|
Account string `json:"Account" binding:"required"`
|
||
|
|
Password string `json:"Password" binding:"required"`
|
||
|
|
Phone string `json:"Phone" binding:"required"`
|
||
|
|
Channels string `json:"Channels"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// DelUserReq 删除角色
|
||
|
|
type DelUserReq struct {
|
||
|
|
ID int `json:"ID" binding:"required"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type RoleListResp struct {
|
||
|
|
List []Role
|
||
|
|
}
|
||
|
|
|
||
|
|
// AddRoleReq 新增角色
|
||
|
|
type AddRoleReq struct {
|
||
|
|
Role int `json:"Role" binding:"required"`
|
||
|
|
Name string `json:"Name" binding:"required"`
|
||
|
|
Power string `json:"Power" binding:"required"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// EditRoleReq 编辑角色
|
||
|
|
type EditRoleReq struct {
|
||
|
|
ID int `json:"ID" binding:"required"`
|
||
|
|
Role int `json:"Role" binding:"required"`
|
||
|
|
Name string `json:"Name" binding:"required"`
|
||
|
|
Power string `json:"Power" binding:"required"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// EditPowerReq 编辑权限
|
||
|
|
// ID 账户id
|
||
|
|
// Power 用户编辑后的权限
|
||
|
|
type EditPowerReq struct {
|
||
|
|
ID int `json:"ID" binding:"required"`
|
||
|
|
Power *string `json:"Power"`
|
||
|
|
Role *int `json:"Role"`
|
||
|
|
Name *string `json:"Name"`
|
||
|
|
Account *string `json:"Account"`
|
||
|
|
Password *string `json:"Password"`
|
||
|
|
Phone *string `json:"Phone"`
|
||
|
|
Channels *string `json:"Channels"`
|
||
|
|
}
|