|
|
|
|
package values
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"server/common"
|
|
|
|
|
"server/util"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// GMAddCoinReq 后台修改玩家金币
|
|
|
|
|
// UID 玩家id
|
|
|
|
|
// Currency 货币类型
|
|
|
|
|
// Amount 请求的金币数量,可以是负数
|
|
|
|
|
type GMAddCoinReq struct {
|
|
|
|
|
UID int `json:"UID" binding:"required"`
|
|
|
|
|
CurrencyType common.CurrencyType `json:"CurrencyType" binding:"required"`
|
|
|
|
|
Amount int64 `json:"Amount" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMRechargeReq 后台模拟充值
|
|
|
|
|
// UID 玩家id
|
|
|
|
|
// CurrencyType 请求的货币类型
|
|
|
|
|
// Amount 数量
|
|
|
|
|
type GMRechargeReq struct {
|
|
|
|
|
UID int `json:"UID" binding:"required"`
|
|
|
|
|
CurrencyType common.CurrencyType `json:"CurrencyType"`
|
|
|
|
|
Amount int64 `json:"Amount"`
|
|
|
|
|
ProductID int `json:"ProductID"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMResetSignReq 后台重置签到
|
|
|
|
|
// UID 玩家id
|
|
|
|
|
// Type 请求重置的类型 1 今日 2 全部
|
|
|
|
|
type GMResetSignReq struct {
|
|
|
|
|
UID int `json:"UID" binding:"required"`
|
|
|
|
|
Type int `json:"Type" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMBindPhoneReq 后台绑定手机
|
|
|
|
|
// UID 玩家id
|
|
|
|
|
// Phone 请求绑定的手机号
|
|
|
|
|
type GMBindPhoneReq struct {
|
|
|
|
|
UID int `json:"UID" binding:"required"`
|
|
|
|
|
Phone string `json:"Phone" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMUnBindPhoneReq 后台解除绑定手机
|
|
|
|
|
// UID 玩家id
|
|
|
|
|
type GMUnBindPhoneReq struct {
|
|
|
|
|
UID int `json:"UID" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMUnBindPhoneReq 后台获取手机验证码
|
|
|
|
|
// Phone 手机号
|
|
|
|
|
type GMGetPhoneCodeReq struct {
|
|
|
|
|
Phone string `json:"Phone" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMGetPhoneCodeResp 后台获取手机验证码
|
|
|
|
|
// Code 验证码
|
|
|
|
|
type GMGetPhoneCodeResp struct {
|
|
|
|
|
Code string `json:"Code" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMConfigPlatformListResp 后台获取平台配置参数
|
|
|
|
|
type GMConfigPlatformListResp struct {
|
|
|
|
|
Config *common.ConfigPlatform
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMConfigPlatformEditReq 后台修改平台配置参数
|
|
|
|
|
type GMConfigPlatformEditReq struct {
|
|
|
|
|
Config *common.ConfigPlatform
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type GMConfigCommonListReq struct {
|
|
|
|
|
Page int
|
|
|
|
|
PageSize int
|
|
|
|
|
Condition map[string]interface{}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMConfigCommonListResp 后台获取调控配置通用接口
|
|
|
|
|
type GMConfigCommonListResp struct {
|
|
|
|
|
Config interface{}
|
|
|
|
|
Total int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMConfigCommonEditReq 后台修改调控配置通用接口
|
|
|
|
|
type GMConfigCommonEditReq struct {
|
|
|
|
|
Config []map[string]interface{}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMConfigCommonDelReq 后台删除调控配置通用接口
|
|
|
|
|
type GMConfigCommonDelReq struct {
|
|
|
|
|
ID int
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetControlType(path string) int {
|
|
|
|
|
switch path {
|
|
|
|
|
case "rwPer":
|
|
|
|
|
return common.ReloadConfigRWPer
|
|
|
|
|
case "all":
|
|
|
|
|
return common.ReloadConfigActivity
|
|
|
|
|
case "payProduct":
|
|
|
|
|
return common.ReloadConfigPayProduct
|
|
|
|
|
case "h5":
|
|
|
|
|
return common.ReloadConfigH5
|
|
|
|
|
case "tron":
|
|
|
|
|
return common.ReloadConfigTron
|
|
|
|
|
case "withdraw":
|
|
|
|
|
return common.ReloadConfigWithdrawProduct
|
|
|
|
|
case "firstPageGames":
|
|
|
|
|
return common.ReloadConfigFirstPageGames
|
|
|
|
|
case "vip":
|
|
|
|
|
return common.ReloadConfigVip
|
|
|
|
|
case "water":
|
|
|
|
|
return common.ReloadConfigWater
|
|
|
|
|
case "robot":
|
|
|
|
|
return common.ReloadConfigRobot
|
|
|
|
|
case "appSpin":
|
|
|
|
|
return common.ReloadConfigAppSpin
|
|
|
|
|
case "shareSys":
|
|
|
|
|
return common.ReloadConfigShareSys
|
|
|
|
|
case "pddSpin":
|
|
|
|
|
return common.ReloadConfigActivityPddSpin
|
|
|
|
|
//case "pdd":
|
|
|
|
|
// return common.ReloadConfigActivityPdd
|
|
|
|
|
case "task":
|
|
|
|
|
return common.ReloadConfigTask
|
|
|
|
|
case "currencyResource":
|
|
|
|
|
return common.ReloadConfigCurrencyResource
|
|
|
|
|
case "firstPay":
|
|
|
|
|
return common.ReloadConfigFirstPay
|
|
|
|
|
case "freespin":
|
|
|
|
|
return common.ReloadConfigActivityFreeSpin
|
|
|
|
|
case "firstRechargeBack":
|
|
|
|
|
return common.ReloadConfigActivityFirstRechargeBack
|
|
|
|
|
case "luckCode":
|
|
|
|
|
return common.ReloadConfigLuckyCode
|
|
|
|
|
case "luckCodeList":
|
|
|
|
|
return common.ReloadConfigLuckyCodeList
|
|
|
|
|
case "banner":
|
|
|
|
|
return common.ReloadConfigBanner
|
|
|
|
|
case "sign":
|
|
|
|
|
return common.ReloadConfigActivitySign
|
|
|
|
|
case "breakGift":
|
|
|
|
|
return common.ReloadConfigActivityBreakGift
|
|
|
|
|
case "shareRobot":
|
|
|
|
|
return common.ReloadConfigShareRobot
|
|
|
|
|
case "slots":
|
|
|
|
|
return common.ReloadConfigActivitySlots
|
|
|
|
|
case "luckyShop":
|
|
|
|
|
return common.ReloadConfigActivityLuckyShop
|
|
|
|
|
case "serverFlag":
|
|
|
|
|
return common.ReloadConfigServerFlag
|
|
|
|
|
case "sevenDayBox":
|
|
|
|
|
return common.ReloadConfigActivitySevenDayBox
|
|
|
|
|
case "super":
|
|
|
|
|
return common.ReloadConfigActivitySuper
|
|
|
|
|
case "tgRobot":
|
|
|
|
|
return common.ReloadConfigTgRobot
|
|
|
|
|
case "betDraw":
|
|
|
|
|
return common.ReloadConfigBetDraw
|
|
|
|
|
case "activityPopup":
|
|
|
|
|
return common.ReloadConfigActivityPopup
|
|
|
|
|
case "discountTicket":
|
|
|
|
|
return common.ReloadConfigDiscountTicket
|
|
|
|
|
case "configRtp":
|
|
|
|
|
return common.ReloadConfigRTP
|
|
|
|
|
case "configShareRankReward":
|
|
|
|
|
return common.ReloadConfigRankReward
|
|
|
|
|
case "configShareRankRule":
|
|
|
|
|
return common.ReloadConfigRankRule
|
|
|
|
|
// aagame新增/复用
|
|
|
|
|
case "gameTypes":
|
|
|
|
|
return common.ReloadConfigGameTypes
|
|
|
|
|
case "gameMarks":
|
|
|
|
|
return common.ReloadConfigGameMarks
|
|
|
|
|
case "gameClassify":
|
|
|
|
|
return common.ReloadConfigGameClassify
|
|
|
|
|
case "gameList":
|
|
|
|
|
return common.ReloadConfigGameList
|
|
|
|
|
case "gameProvider":
|
|
|
|
|
return common.ReloadConfigGameProvider
|
|
|
|
|
case "rank":
|
|
|
|
|
return common.ReloadConfigRank
|
|
|
|
|
case "gameTag":
|
|
|
|
|
return common.ReloadConfigGameTag
|
|
|
|
|
case "showGameTag":
|
|
|
|
|
return common.ReloadConfigShowGameTag
|
|
|
|
|
case "popUp":
|
|
|
|
|
return common.ReloadConfigPopUp
|
|
|
|
|
case "pdd":
|
|
|
|
|
return common.ReloadConfigPdd
|
|
|
|
|
case "luckyWheel":
|
|
|
|
|
return common.ReloadConfigLuckyWheel
|
|
|
|
|
case "share":
|
|
|
|
|
return common.ReloadConfigShare
|
|
|
|
|
case "shareWithdrawProducts":
|
|
|
|
|
return common.ReloadConfigShareWithdrawProducts
|
|
|
|
|
case "shareLimitTask":
|
|
|
|
|
return common.ReloadConfigShareLimitTask
|
|
|
|
|
case "shareTaskNew":
|
|
|
|
|
return common.ReloadConfigShareTaskNew
|
|
|
|
|
case "shareBanner":
|
|
|
|
|
return common.ReloadConfigShareBanner
|
|
|
|
|
case "shareRankAward":
|
|
|
|
|
return common.ReloadTypeConfigShareRankAward
|
|
|
|
|
case "weekCard":
|
|
|
|
|
return common.ReloadConfigWeekCard
|
|
|
|
|
case "rtpControl":
|
|
|
|
|
return common.ReloadConfigRtpControl
|
|
|
|
|
default:
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMConfigReloadServerVersionReq 后台热更服务器更新
|
|
|
|
|
type GMConfigReloadServerVersionReq struct {
|
|
|
|
|
ServerID int
|
|
|
|
|
Version int
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GMConfigPayWeightResp 后台获取支付权重
|
|
|
|
|
type GMConfigPayWeightResp struct {
|
|
|
|
|
Config interface{}
|
|
|
|
|
Status int
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 强制玩家短线
|
|
|
|
|
type OptPlayerDisconnectReq struct {
|
|
|
|
|
UserId []int // 用户id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CheckQueryControl 某些控制查询时,有特殊条件
|
|
|
|
|
func CheckQueryControl(data interface{}, req *GMConfigCommonListReq) (string, string) {
|
|
|
|
|
switch data.(type) {
|
|
|
|
|
case *common.ConfigActivityPddSpin:
|
|
|
|
|
return "", "amount_down,sort"
|
|
|
|
|
case *common.ConfigGameList:
|
|
|
|
|
if req != nil && req.Condition != nil {
|
|
|
|
|
sql := ""
|
|
|
|
|
providerSql := ""
|
|
|
|
|
tagIdsSql := ""
|
|
|
|
|
gameProviderList, ok := req.Condition["GameProvider"]
|
|
|
|
|
if ok {
|
|
|
|
|
var gameProviderValue string
|
|
|
|
|
for _, v := range gameProviderList.([]interface{}) {
|
|
|
|
|
if gameProviderValue != "" {
|
|
|
|
|
gameProviderValue += ","
|
|
|
|
|
}
|
|
|
|
|
gameProviderValue += fmt.Sprintf("%d", util.ToInt(v))
|
|
|
|
|
}
|
|
|
|
|
providerSql = fmt.Sprintf(" `game_provider` in (%s)", gameProviderValue)
|
|
|
|
|
}
|
|
|
|
|
tagIds, ok := req.Condition["TagIds"]
|
|
|
|
|
if ok {
|
|
|
|
|
for _, v := range tagIds.([]interface{}) {
|
|
|
|
|
if tagIdsSql != "" {
|
|
|
|
|
tagIdsSql += " or "
|
|
|
|
|
}
|
|
|
|
|
tagIdsSql += fmt.Sprintf(" JSON_CONTAINS(`tag_ids`, '%d') ", util.ToInt(v))
|
|
|
|
|
}
|
|
|
|
|
tagIdsSql = fmt.Sprintf(" `tag_ids` != '' and ( %s )", tagIdsSql)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if providerSql != "" {
|
|
|
|
|
sql += providerSql
|
|
|
|
|
}
|
|
|
|
|
if tagIdsSql != "" {
|
|
|
|
|
if sql != "" {
|
|
|
|
|
sql += fmt.Sprintf(" and ( %s ) ", tagIdsSql)
|
|
|
|
|
} else {
|
|
|
|
|
sql = tagIdsSql
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sql, ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return "", ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CheckUpdateControl 某些控制更新时,有特殊条件
|
|
|
|
|
func CheckUpdateControl(data interface{}) {
|
|
|
|
|
}
|