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.
154 lines
5.8 KiB
154 lines
5.8 KiB
package values |
|
|
|
// 权限对应页签 |
|
const ( |
|
PowerAll = iota |
|
// 系统管理从1开始 |
|
PowerFirst // 首页 |
|
PowerGM // 系统配置 |
|
PowerMail // 邮件 |
|
PowerWhiteList // 黑白名单 |
|
PowerChannel // 渠道管理 |
|
PowerExamineWithdraw // 退出订单审核 |
|
PowerStatisticsWithdraw // 退出订单统计 |
|
PowerManageRole // 角色管理账户权限 |
|
PowerManageUser // 用户管理账户权限 |
|
PowerOptLog // 操作日志权限 |
|
PowerWarn // 预警模块权限 |
|
PowerGUser // 游戏玩家管理 |
|
PowerGUserList // 游戏玩家列表 |
|
PowerShareChannel // 分享配置 |
|
PowerBlockpayQuery // 区块支付查询功能 |
|
PowerBlockpayAddrs // 区块支付地址功能(包括转账权限等) |
|
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 |
|
PowerOutput // 产出统计 115 |
|
|
|
// PowerControlCardData // 调控牌局 113 |
|
// PowerPlayGameData // 玩家游戏数据 114 |
|
// PowerRechargeTrend // 充值趋势 115 |
|
// PowerBalanceRoomGame // 房间游戏盈亏 116 |
|
// PowerBalanceMillionGame // 百人场游戏盈亏 117 |
|
// PowerRouletteActivityData // 轮盘活动数据 118 |
|
PowerMax2 |
|
) |
|
|
|
func IsValidPower(p int) bool { |
|
if p > PowerAll && p < PowerMax1 || p >= PowerRealData && p < PowerMax2 { |
|
return true |
|
} |
|
return false |
|
} |
|
|
|
var ( |
|
// 权限映射表 |
|
PowerMap = map[string]int{ |
|
"/statistics/reviewData": PowerFirst, |
|
"/gm": PowerGM, |
|
"/mail": PowerMail, |
|
"/sys/whiteList": PowerWhiteList, |
|
"/sys/channel": PowerChannel, |
|
"/examine/withdraw": PowerExamineWithdraw, |
|
"/statistics/realData": PowerRealData, |
|
"/statistics/gameData": PowerGameData, |
|
"/statistics/newPlayerData": PowerNewPlayData, |
|
"/statistics/activePlayerData": PowerActivePlayData, |
|
"/statistics/rechargeData": PowerRechargeData, |
|
"/statistics/rechargeData/rechargeOrderList": PowerRechargeOrder, |
|
"/statistics/rechargeData/withdrawOrderList": PowerWithdrawOrder, |
|
"/statistics/playData": PowerPlayData, |
|
"/statistics/withdraw": PowerStatisticsWithdraw, |
|
"/statistics/output": PowerOutput, |
|
"/power/role": PowerManageRole, |
|
"/power/user": PowerManageUser, |
|
"/sys/editHistory/list": PowerOptLog, |
|
"/warn": PowerWarn, |
|
"/guser": PowerGUser, |
|
"/guser/list": PowerGUserList, |
|
"/share": PowerShareChannel, |
|
"/statistics/shareData": PowerShareData, |
|
"/statistics/realDataBalance": PowerRealProfit, |
|
"/statistics/activityRedData": PowerRedActivity, |
|
"/blockpay/order/query": PowerBlockpayQuery, |
|
"/blockpay/addrs": PowerBlockpayAddrs, |
|
"/profit/playerProfit": PowerPlayerProfit, |
|
// "/guser/controlCardData": PowerControlCardData, |
|
// "/statistics/playGameData": PowerPlayGameData, |
|
// "/statistics/rechargeTrend": PowerRechargeTrend, |
|
// "/statistics/realDataBalanceRoomGame": PowerBalanceRoomGame, |
|
// "/statistics/realDataBalanceMillionGame": PowerBalanceMillionGame, |
|
// "/activity/rouletteActivityData": PowerRouletteActivityData, |
|
} |
|
// 页面按钮权限 |
|
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"` |
|
}
|
|
|