印度包网
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.

283 lines
7.3 KiB

1 year ago
package values
import (
2 months ago
"fmt"
1 year ago
"server/common"
2 months ago
"server/util"
1 year ago
)
// 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
}
2 months ago
type GMConfigCommonListReq struct {
Page int
PageSize int
Condition map[string]interface{}
}
1 year ago
// GMConfigCommonListResp 后台获取调控配置通用接口
type GMConfigCommonListResp struct {
Config interface{}
2 months ago
Total int64
1 year ago
}
// 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
3 months ago
//case "pdd":
// return common.ReloadConfigActivityPdd
1 year ago
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
3 months ago
case "luckCodeList":
return common.ReloadConfigLuckyCodeList
1 year ago
case "banner":
return common.ReloadConfigBanner
case "sign":
return common.ReloadConfigActivitySign
case "breakGift":
return common.ReloadConfigActivityBreakGift
case "shareRobot":
return common.ReloadConfigShareRobot
case "weekCard":
return common.ReloadConfigActivityWeekCard
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
1 year ago
case "tgRobot":
return common.ReloadConfigTgRobot
1 year ago
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
3 months ago
// 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
3 months ago
case "popUp":
return common.ReloadConfigPopUp
case "pdd":
return common.ReloadConfigPdd
case "luckyWheel":
return common.ReloadConfigLuckyWheel
3 months ago
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
2 months ago
case "shareRankAward":
return common.ReloadTypeConfigShareRankAward
1 year ago
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 某些控制查询时,有特殊条件
2 months ago
func CheckQueryControl(data interface{}, req *GMConfigCommonListReq) (string, string) {
1 year ago
switch data.(type) {
case *common.ConfigActivityPddSpin:
return "", "amount_down,sort"
2 months ago
case *common.ConfigGameList:
if req != nil && req.Condition != nil {
sql := ""
2 months ago
providerSql := ""
tagIdsSql := ""
2 months ago
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))
}
2 months ago
providerSql = fmt.Sprintf(" `game_provider` in (%s)", gameProviderValue)
2 months ago
}
2 months ago
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
}
}
2 months ago
return sql, ""
}
1 year ago
}
return "", ""
}
// CheckUpdateControl 某些控制更新时,有特殊条件
func CheckUpdateControl(data interface{}) {
}