From 6239a423d42e984fdbb884928ad457c2c08a0c94 Mon Sep 17 00:00:00 2001 From: mofangmin Date: Fri, 2 Aug 2024 15:15:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=BC=B9=E7=AA=97=E5=92=8C?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- call/config.go | 29 ++++++++ call/pay.go | 16 +++-- call/reload.go | 11 ++- call/task.go | 6 +- common/activity.go | 19 +++++ common/config.go | 3 + common/currency.go | 7 +- common/recharge.go | 1 + modules/backend/migrate.go | 1 + modules/backend/values/gm.go | 2 + modules/web/app/activity.go | 78 -------------------- modules/web/app/balance.go | 19 ++--- modules/web/handler/activity.go | 94 ++++++++++++++++++++++++- modules/web/handler/firstpage.go | 7 ++ modules/web/handler/recharge.go | 7 +- modules/web/handler/task.go | 32 ++++----- modules/web/handler/user.go | 2 + modules/web/handler/withdraw.go | 2 +- modules/web/middleware/token.go | 79 +++++++++++---------- modules/web/routers/routers_activity.go | 2 + modules/web/values/activity.go | 8 +++ modules/web/values/firstpage.go | 1 + modules/web/values/pay.go | 2 + modules/web/values/protocol.go | 7 +- 24 files changed, 273 insertions(+), 162 deletions(-) diff --git a/call/config.go b/call/config.go index ef7a4d5..f046581 100644 --- a/call/config.go +++ b/call/config.go @@ -63,6 +63,7 @@ var ( configActivitySuper []*common.ConfigActivitySuper configTgRobot []*common.ConfigTgRobot configBetDraw []*common.ConfigActivityBetDraw + configActivityPopup []*common.ConfigActivityPopup ) var ( @@ -1092,6 +1093,10 @@ func LoadConfigCurrencyResource() (err error) { return } +func GetConfigCurrencyResource() []*common.ConfigCurrencyResource { + return configCurrencyResource +} + func GetConfigCurrencyResourceMultiple(t common.CurrencyRes) int64 { for _, v := range configCurrencyResource { if v.Type == t { @@ -1524,3 +1529,27 @@ func GetConfigBetDrawByType(t int) ([]*common.ConfigActivityBetDraw, []int64) { } return ret, weight } + +func LoadConfigActivityPopup() (err error) { + var list []*common.ConfigActivityPopup + if _, err = db.Mysql().QueryAll("", "", &common.ConfigActivityPopup{}, &list); err != nil { + log.Error("err:%v", err) + return err + } + configActivityPopup = list + return nil +} + +func GetConfigActivityPopup() []*common.ConfigActivityPopup { + return configActivityPopup +} + +func GetConfigActivityPopupByType(jumpType int) []*common.ConfigActivityPopup { + var ret []*common.ConfigActivityPopup + for _, item := range configActivityPopup { + if item.JumpType == jumpType { + ret = append(ret, item) + } + } + return ret +} diff --git a/call/pay.go b/call/pay.go index a4074c8..58b49cf 100644 --- a/call/pay.go +++ b/call/pay.go @@ -222,7 +222,7 @@ func RechargeCallback(r *common.RechargeOrder, success bool, payAccount, extra s } // 第三步,给玩家发货 // 正常商城充值 - var bonus int64 + var bonus = r.Bonus if r.ProductID == 0 { amount := PayExtra(r) // 判断特殊购买,如优惠券 if amount == 0 { @@ -245,9 +245,13 @@ func RechargeCallback(r *common.RechargeOrder, success bool, payAccount, extra s // return // } // } else { - per := GetConfigFirstPayPerByAmount(notCharge, amount) - if per > 0 { - bonus = amount * per / 100 + // per := GetConfigFirstPayPerByAmount(notCharge, amount) + // if per > 0 { + // bonus = amount * per / 100 + // } + needBet := GetConfigCurrencyResourceNeedBet(common.CurrencyResourceRecharge, amount) + if bonus > 0 { + needBet = GetConfigCurrencyResourceNeedBet(common.CurrencyResourceRechargeBonus, amount+bonus) } cb := &common.CurrencyBalance{ UID: r.UID, @@ -257,7 +261,7 @@ func RechargeCallback(r *common.RechargeOrder, success bool, payAccount, extra s Exs1: r.OrderID, Exi1: int(amount), // 充值金额传递 Exi2: r.ProductID, - NeedBet: GetConfigCurrencyResourceNeedBet(common.CurrencyResourceRecharge, amount) + GetConfigCurrencyResourceNeedBet(common.CurrencyResourceBonus, bonus), + NeedBet: needBet, } err = UpdateCurrencyProReal(&common.UpdateCurrency{ CurrencyBalance: cb, @@ -418,7 +422,7 @@ func ReturnBackWithdraw(or *common.WithdrawOrder, originStatus, status uint8, pa "total_withdrawing": gorm.Expr("total_withdrawing - ?", or.Amount), "day_withdraw": gorm.Expr("day_withdraw - ?", or.Amount), } - if status == common.StatusROrderFail { + if status == common.StatusROrderFail || status == common.StatusROrderRefuse { updateRe["withdraw_count"] = gorm.Expr("withdraw_count + ?", -1) } err := tx.Model(re).Where("uid = ? and withdrawing_cash >= ? and total_withdrawing >= ?", or.UID, or.WithdrawCash, or.Amount). diff --git a/call/reload.go b/call/reload.go index 87bad48..4a50267 100644 --- a/call/reload.go +++ b/call/reload.go @@ -448,7 +448,6 @@ func CommonReload(c map[int][]func(*pb.ReloadGameConfig) error) { return nil }} } - // 为 BetDraw 注册重新加载函数 if _, ok := c[common.ReloadConfigBetDraw]; !ok { c[common.ReloadConfigBetDraw] = []func(*pb.ReloadGameConfig) error{func(rgc *pb.ReloadGameConfig) error { if err := LoadBetDraw(); err != nil { @@ -458,5 +457,13 @@ func CommonReload(c map[int][]func(*pb.ReloadGameConfig) error) { return nil }} } - + if _, ok := c[common.ReloadConfigActivityPopup]; !ok { + c[common.ReloadConfigActivityPopup] = []func(*pb.ReloadGameConfig) error{func(rgc *pb.ReloadGameConfig) error { + if err := LoadConfigActivityPopup(); err != nil { + log.Error("error : [%s]", err.Error()) + return err + } + return nil + }} + } } diff --git a/call/task.go b/call/task.go index 652cdd9..55ee6ad 100644 --- a/call/task.go +++ b/call/task.go @@ -15,7 +15,7 @@ type Task struct { Value int64 // 进度值 } -func CheckTask(task Task) { +func CheckTask(task Task) (taskId int) { log.Info("checkTask task:%v", task) now := time.Now().Unix() con := GetConfigTask() @@ -29,6 +29,7 @@ func CheckTask(task Task) { } else if data.Progress == 0 { db.Mysql().Update(&common.TaskData{UID: uid, TaskID: v.TaskID}, map[string]interface{}{"progress": v.Target, "time": now}) } + taskId = v.TaskID break } else if (t == common.TaskTypeBet1000 || t == common.TaskTypeBet10000 || t == common.TaskTypePlayGame) && v.Type == t { data := GetUserTaskDataByTaskID(task.Uid, v.TaskID) @@ -37,9 +38,10 @@ func CheckTask(task Task) { } else { db.Mysql().Update(&common.TaskData{UID: uid, TaskID: v.TaskID}, map[string]interface{}{"progress": gorm.Expr("progress + ?", task.Value), "time": now}) } + taskId = v.TaskID break } } - } + return } diff --git a/common/activity.go b/common/activity.go index eef29f7..9c6ee7e 100644 --- a/common/activity.go +++ b/common/activity.go @@ -501,3 +501,22 @@ type ActivityBetDrawData struct { func (c *ActivityBetDrawData) TableName() string { return "config_betdraw_data" } + +// ConfigActivityPopup 活动弹窗 +type ConfigActivityPopup struct { + ID int `gorm:"primarykey"` + ActivityId int `gorm:"column:activity_id;type:int(11);comment:活动唯一标识" web:"activity_id"` + ActivityName string `gorm:"column:activity_name;type:varchar(255);comment:活动名称;NOT NULL" web:"activity_name"` + BannerImage string `gorm:"column:banner_image;type:varchar(255);comment:banner图路径或URL;NOT NULL" web:"banner_image"` + Description string `gorm:"column:description;type:text;comment:活动描述" web:"description"` + JumpType int `gorm:"column:jump_type;type:int(11);comment:跳转类型;NOT NULL" web:"jump_type"` + ButtonText string `gorm:"column:button_text;type:varchar(255);comment:按钮文字" web:"button_text"` + IsEnabled int `gorm:"column:is_enabled;type:tinyint(1);default:1;comment:是否开启活动;NOT NULL" web:"is_enabled"` + StartDate int64 `gorm:"column:start_date;type:bigint(20);comment:活动开始时间(Unix时间戳)" web:"start_date"` + EndDate int64 `gorm:"column:end_date;type:bigint(20);comment:活动结束时间(Unix时间戳)" web:"end_date"` + AdditionalInfo string `gorm:"column:additional_info;type:text;comment:附加信息" web:"additional_info"` +} + +func (c *ConfigActivityPopup) TableName() string { + return "config_activity_popup" +} diff --git a/common/config.go b/common/config.go index 2cf6e22..8ff7751 100644 --- a/common/config.go +++ b/common/config.go @@ -51,6 +51,7 @@ const ( ReloadConfigActivitySuper // 超级1+2 ReloadConfigTgRobot // tg机器人配置 ReloadConfigBetDraw // 下注抽奖 + ReloadConfigActivityPopup // 活动弹窗 ) // GetConfigStructByType 获取相应配置的结构 @@ -140,6 +141,8 @@ func GetConfigStructByType(t int) (interface{}, interface{}) { return &ConfigTgRobot{}, &[]ConfigTgRobot{} case ReloadConfigBetDraw: return &ConfigActivityBetDraw{}, &[]ConfigActivityBetDraw{} + case ReloadConfigActivityPopup: + return &ConfigActivityPopup{}, &[]ConfigActivityPopup{} default: return nil, nil } diff --git a/common/currency.go b/common/currency.go index 7a4cc00..b8fb1e2 100644 --- a/common/currency.go +++ b/common/currency.go @@ -23,9 +23,10 @@ type CurrencyRes int // 货币来源(会影响所需下注量) const ( - CurrencyResourceZero CurrencyRes = iota - CurrencyResourceRecharge // 一般充值 - CurrencyResourceBonus // 额外赠送 + CurrencyResourceZero CurrencyRes = iota + CurrencyResourceRecharge // 一般充值 + CurrencyResourceBonus // 额外赠送 + CurrencyResourceRechargeBonus // bonus充值 CurrencyResourceAll ) diff --git a/common/recharge.go b/common/recharge.go index d9be154..b65dcee 100644 --- a/common/recharge.go +++ b/common/recharge.go @@ -136,6 +136,7 @@ type RechargeOrder struct { Remarks string `gorm:"column:remarks;type:varchar(255);comment:备注" redis:"remarks"` CallbackTime int64 `gorm:"column:callback_time;type:bigint(20);comment:到账时间" redis:"callback_time"` UPI int `gorm:"column:upi;not null;type:int(11);comment:玩家选择的upi"` + Bonus int64 `gorm:"column:bonus;type:bigint(20);default:0;comment:选择了bonus后赠送的数额"` } func (r *RechargeOrder) TableName() string { diff --git a/modules/backend/migrate.go b/modules/backend/migrate.go index 0efab16..b8c8c8a 100644 --- a/modules/backend/migrate.go +++ b/modules/backend/migrate.go @@ -113,6 +113,7 @@ func MigrateDB() { new(common.ConfigTgRobot), new(common.ConfigActivityBetDraw), new(common.ActivityBetDrawData), + new(common.ConfigActivityPopup), ) if err != nil { panic("Migrate db fail") diff --git a/modules/backend/values/gm.go b/modules/backend/values/gm.go index 9257f4a..2fc22b8 100644 --- a/modules/backend/values/gm.go +++ b/modules/backend/values/gm.go @@ -160,6 +160,8 @@ func GetControlType(path string) int { return common.ReloadConfigTgRobot case "betDraw": return common.ReloadConfigBetDraw + case "activityPopup": + return common.ReloadConfigActivityPopup default: return 0 } diff --git a/modules/web/app/activity.go b/modules/web/app/activity.go index a470277..e71cc23 100644 --- a/modules/web/app/activity.go +++ b/modules/web/app/activity.go @@ -2,14 +2,7 @@ package app import ( "server/call" - "server/common" - "server/db" "server/modules/web/values" - "server/util" - "sort" - "time" - - "github.com/liangdas/mqant/log" ) // 从数据库中读取数据 @@ -26,74 +19,3 @@ func (g *Gin) CheckActivityExpire(id int) (pass bool) { } return } - -// GetUserTaskStatus 获取任务状态 -func (a *Gin) GetUserTaskStatus() (ret []*values.OneTask) { - tasks := call.GetConfigTask() - for _, v := range tasks { - one := &values.OneTask{ - ID: v.ID, - TaskID: v.TaskID, - Target: v.Target, - Reward: v.Reward, - Kind: v.Kind, - Type: int(v.Type), - Icon: v.Icon, - Title: common.GetTaskTitle(v), - Action: v.Action, - } - // 非次数任务,需转换目标数值 - // if !common.IsNumTaskType(v.Type) { - // one.Target /= common.DecimalDigits - // } - ret = append(ret, one) - } - if a.UID <= 0 { - return - } - - now := time.Now() - task := call.GetUserTaskData(a.UID) - for _, v := range ret { - for _, k := range task { - if v.TaskID == k.TaskID { - v.Progess = k.Progress - taskTime := time.Unix(k.Time, 0) - // 跨天清空数据 - if !util.IsSameDay(now, taskTime) && v.Kind == common.TaskKindDayOne { - v.Status = 0 - v.Progess = 0 - err := db.Mysql().Update(&k, map[string]interface{}{ - "progress": 0, - "time": now.Unix(), - }) - if err != nil { - log.Error("GetUserTaskStatus err:%v", err) - } - } - - break - } - } - if v.Type == int(common.TaskTypeDownload) { // 已下载直接标记为完成 - if a.DeviceType == common.DeviceTypeWebview || a.DeviceType == common.DeviceTypePWA { - call.CheckTask(call.Task{Uid: a.UID, Value: 0, Types: []common.TaskType{common.TaskTypeDownload}}) - } - } - // 非次数任务,需转换目标数值 - // if !common.IsNumTaskType(v.Type) && v.Progess > 0 { - // v.Progess /= common.DecimalDigits - // } - if v.Progess < 0 { - v.Progess = v.Target - v.Status = 2 - } else if v.Progess >= v.Target { - v.Progess = v.Target - v.Status = 1 - } - } - sort.SliceStable(ret, func(i, j int) bool { - return ret[i].Status > ret[j].Status - }) - return -} diff --git a/modules/web/app/balance.go b/modules/web/app/balance.go index adfcb39..7ed6e7c 100644 --- a/modules/web/app/balance.go +++ b/modules/web/app/balance.go @@ -34,15 +34,18 @@ func (g *Gin) CheckWithdrawCondition(amount int64, t common.CurrencyType) (ok bo g.Msg = fmt.Sprintf("अपर्याप्त वीआईपी स्तर आपकी टॉप-अप राशि R( $ %d VIP1 बनने और अपना पैसा निकालने में सक्षम होने के लिए.", limit) return } - // con := call.GetVipCon(g.UID) - // if con == nil { - // g.Code = values.CodeWithdrawCondition - // return - // } + re := call.GetRechargeInfo(g.UID) + con := call.GetVipCon(g.UID) + if con == nil { + g.Code = values.CodeWithdrawCondition + return + } // if re.DayWithdraw+amount >= con.WithdrawLimit || re.WithdrawCount+1 >= con.WithdrawCount { - // g.Code = values.CodeWithdrawLimit - // return - // } + if re.WithdrawCount >= con.WithdrawCount { + g.Code = values.CodeWithdrawLimit + g.Msg = "निकासी की संख्या आज तक पहुंच गई है।" + return + } ok = true return diff --git a/modules/web/handler/activity.go b/modules/web/handler/activity.go index fff16d8..72698b3 100644 --- a/modules/web/handler/activity.go +++ b/modules/web/handler/activity.go @@ -10,6 +10,7 @@ import ( "server/modules/web/app" "server/modules/web/values" "server/util" + "sort" "time" "github.com/gin-gonic/gin" @@ -18,6 +19,79 @@ import ( "gorm.io/gorm" ) +// GetUserTaskStatus 获取任务状态 +func GetUserTaskStatus(a *app.Gin) (ret []*values.OneTask) { + tasks := call.GetConfigTask() + for _, v := range tasks { + one := &values.OneTask{ + ID: v.ID, + TaskID: v.TaskID, + Target: v.Target, + Reward: v.Reward, + Kind: v.Kind, + Type: int(v.Type), + Icon: v.Icon, + Title: common.GetTaskTitle(v), + Action: v.Action, + } + // 非次数任务,需转换目标数值 + // if !common.IsNumTaskType(v.Type) { + // one.Target /= common.DecimalDigits + // } + ret = append(ret, one) + } + if a.UID <= 0 { + return + } + + now := time.Now() + task := call.GetUserTaskData(a.UID) + for _, v := range ret { + for _, k := range task { + if v.TaskID == k.TaskID { + v.Progess = k.Progress + taskTime := time.Unix(k.Time, 0) + // 跨天清空数据 + if !util.IsSameDay(now, taskTime) && v.Kind == common.TaskKindDayOne { + v.Status = 0 + v.Progess = 0 + err := db.Mysql().Update(&k, map[string]interface{}{ + "progress": 0, + "time": now.Unix(), + }) + if err != nil { + log.Error("GetUserTaskStatus err:%v", err) + } + } + + break + } + } + if v.Type == int(common.TaskTypeDownload) { // 已下载直接标记为完成 + if a.DeviceType == common.DeviceTypeWebview || a.DeviceType == common.DeviceTypePWA { + taskId := call.CheckTask(call.Task{Uid: a.UID, Value: 0, Types: []common.TaskType{common.TaskTypeDownload}}) + // 直接领取下载奖励 + TaskComplete(a, &DrawTaskReq{TaskID: taskId}) + } + } + // 非次数任务,需转换目标数值 + // if !common.IsNumTaskType(v.Type) && v.Progess > 0 { + // v.Progess /= common.DecimalDigits + // } + if v.Progess < 0 { + v.Progess = v.Target + v.Status = 2 + } else if v.Progess >= v.Target { + v.Progess = v.Target + v.Status = 1 + } + } + sort.SliceStable(ret, func(i, j int) bool { + return ret[i].Status > ret[j].Status + }) + return +} + func GetPromotions(c *gin.Context) { a := app.NewApp(c) defer func() { @@ -27,7 +101,7 @@ func GetPromotions(c *gin.Context) { a.Data = ret a.GetUID() ret.ActivityList = call.GetConfigActivityActiveAll(a.UID) - ret.TaskList = a.GetUserTaskStatus() + ret.TaskList = GetUserTaskStatus(a) } func UploadActivityData(c *gin.Context) { @@ -1868,3 +1942,21 @@ func ActivityBetDrawHistory(c *gin.Context) { _, _ = db.ES().QueryList(common.ESIndexBackBetDraw, 0, 5000, q, &resp.SelfList, "Time", false) a.Data = resp } + +func ActivityPopup(c *gin.Context) { + a := app.NewApp(c) + defer func() { + a.Response() + }() + req := values.ActivityPopupReq{} + if !a.S(&req) { + return + } + resp := new(values.ActivityPopupResp) + a.Data = resp + if req.JumpType == 0 { + resp.List = call.GetConfigActivityPopup() + } else { + resp.List = call.GetConfigActivityPopupByType(req.JumpType) + } +} diff --git a/modules/web/handler/firstpage.go b/modules/web/handler/firstpage.go index fc1485f..9662bdd 100644 --- a/modules/web/handler/firstpage.go +++ b/modules/web/handler/firstpage.go @@ -103,6 +103,13 @@ func FirstPage(c *gin.Context) { } resp.ShowData = GetFirstShowData() + for _, item := range call.GetConfigCurrencyResource() { + resp.CurrencyResource = append(resp.CurrencyResource, &common.ConfigCurrencyResource{ + ID: item.ID, + Type: item.Type, + Multiple: item.Multiple / 100, + }) + } } // GetFirstShowData 首页展示数据 diff --git a/modules/web/handler/recharge.go b/modules/web/handler/recharge.go index 5c7f100..481cdc9 100644 --- a/modules/web/handler/recharge.go +++ b/modules/web/handler/recharge.go @@ -286,7 +286,12 @@ func NewRechargeImp(req *values.RechargeReq, uid, cid int, ip string) *RechargeI } } } - + re := call.GetRechargeInfo(uid) + notCharge := re.TotalRecharge == 0 + per := call.GetConfigFirstPayPerByAmount(notCharge, order.Amount) + if per > 0 && req.Bonus { + order.Bonus = order.Amount * per / 100 + } r.UID = uid info, _ := call.GetUserXInfo(uid, "mobile") p := new(PayImp) diff --git a/modules/web/handler/task.go b/modules/web/handler/task.go index 4697c32..6077883 100644 --- a/modules/web/handler/task.go +++ b/modules/web/handler/task.go @@ -22,7 +22,7 @@ func GetTaskInfo(c *gin.Context) { a.Response() }() a.GetUID() - resp := &TaskInfoResp{TaskList: a.GetUserTaskStatus()} + resp := &TaskInfoResp{TaskList: GetUserTaskStatus(a)} a.Data = resp } @@ -30,15 +30,7 @@ type DrawTaskReq struct { TaskID int } -func DrawTask(c *gin.Context) { - a := app.NewApp(c) - defer func() { - a.Response() - }() - req := &DrawTaskReq{} - if !a.S(req) { - return - } +func TaskComplete(a *app.Gin, req *DrawTaskReq) { con := call.GetConfigTaskByTaskID(req.TaskID) if con == nil { a.Code = values.CodeRetry @@ -50,14 +42,6 @@ func DrawTask(c *gin.Context) { a.Msg = "Task not complete." return } - - // 判断是否充值 - // re := call.GetRechargeInfo(a.UID) - // if re.TotalRecharge == 0 { - // a.Code = values.CodeRecharge - // a.Msg = "You can get it after linking the payment method." - // return - // } var rows int64 var err error if con.Kind == common.TaskKindOnce || con.Kind == common.TaskKindDayOne { @@ -91,5 +75,17 @@ func DrawTask(c *gin.Context) { a.Code = values.CodeRetry return } +} + +func DrawTask(c *gin.Context) { + a := app.NewApp(c) + defer func() { + a.Response() + }() + req := &DrawTaskReq{} + if !a.S(req) { + return + } + TaskComplete(a, req) a.Data = req } diff --git a/modules/web/handler/user.go b/modules/web/handler/user.go index 8767108..f27987d 100644 --- a/modules/web/handler/user.go +++ b/modules/web/handler/user.go @@ -58,12 +58,14 @@ func GetUserInfo(c *gin.Context) { resp.CurrentVip.Bonus = vip.Bonus resp.CurrentVip.Cashback = vip.Cashback resp.CurrentVip.WithdrawFee = vip.Fee + resp.CurrentVip.WithdrawCount = vip.WithdrawCount // resp.CurrentVip.Cashback = util.FormatFloat(float64(vip.Cashback)/10, 2) + "%" // resp.CurrentVip.WithdrawFee = util.FormatFloat(float64(vip.Fee)/10, 2) + "%" if nextVip != nil { resp.NextVip.Bonus = nextVip.Bonus resp.NextVip.Cashback = nextVip.Cashback resp.NextVip.WithdrawFee = nextVip.Fee + resp.NextVip.WithdrawCount = nextVip.WithdrawCount // resp.NextVip.Cashback = util.FormatFloat(float64(nextVip.Cashback)/10, 2) + "%" // resp.NextVip.WithdrawFee = util.FormatFloat(float64(nextVip.Fee)/10, 2) + "%" } else { diff --git a/modules/web/handler/withdraw.go b/modules/web/handler/withdraw.go index a97298f..ebac0fa 100644 --- a/modules/web/handler/withdraw.go +++ b/modules/web/handler/withdraw.go @@ -81,7 +81,7 @@ func WithdrawInfo(c *gin.Context) { } resp.Bets = append(resp.Bets, canWithdraw) } - + resp.NeedBet = call.GetUserNeedBet(a.UID) a.Data = resp } diff --git a/modules/web/middleware/token.go b/modules/web/middleware/token.go index 0a8ccbf..f7b44d2 100644 --- a/modules/web/middleware/token.go +++ b/modules/web/middleware/token.go @@ -15,45 +15,46 @@ import ( var ( passURLs = map[string]struct{}{ - "/firstpage": {}, - "/game/list": {}, - "/sys/config": {}, - "/account/email/code": {}, - "/account/email/regist": {}, - "/account/email/login": {}, - "/account/email/resetPass": {}, - "/account/guestLogin": {}, - "/account/gpLogin": {}, - "/account/fbLogin": {}, - "/account/tokenLogin": {}, - "/account/phoneCode/get": {}, - "/account/phoneCode/verify": {}, - "/account/phoneCode/regist": {}, - "/account/phoneCode/login": {}, - "/share/upload": {}, - "/share/config": {}, - "/game/enter": {}, - "/activity/appSpin/info": {}, - "/activity/pdd/info": {}, - "/account/phone/regist": {}, - "/account/phone/login": {}, - "/account/phone/resetPass": {}, - "/balance/recharge/info": {}, - "/share/info": {}, - "/vip/info": {}, - "/share/reference": {}, - "/share/report": {}, - "/share/transfer": {}, - "/task/info": {}, - "/activity/freeSpin/info": {}, - "/promotions": {}, - "/tg/luckyCode": {}, - "/activity/sign/info": {}, - "/ad/uploadFB": {}, - "/activity/slots/info": {}, - "/activity/sign/new/info": {}, - "/activity/betDraw/info": {}, - "/activity/betDraw/record": {}, + "/firstpage": {}, + "/game/list": {}, + "/sys/config": {}, + "/account/email/code": {}, + "/account/email/regist": {}, + "/account/email/login": {}, + "/account/email/resetPass": {}, + "/account/guestLogin": {}, + "/account/gpLogin": {}, + "/account/fbLogin": {}, + "/account/tokenLogin": {}, + "/account/phoneCode/get": {}, + "/account/phoneCode/verify": {}, + "/account/phoneCode/regist": {}, + "/account/phoneCode/login": {}, + "/share/upload": {}, + "/share/config": {}, + "/game/enter": {}, + "/activity/appSpin/info": {}, + "/activity/pdd/info": {}, + "/account/phone/regist": {}, + "/account/phone/login": {}, + "/account/phone/resetPass": {}, + "/balance/recharge/info": {}, + "/share/info": {}, + "/vip/info": {}, + "/share/reference": {}, + "/share/report": {}, + "/share/transfer": {}, + "/task/info": {}, + "/activity/freeSpin/info": {}, + "/promotions": {}, + "/tg/luckyCode": {}, + "/activity/sign/info": {}, + "/ad/uploadFB": {}, + "/activity/slots/info": {}, + "/activity/sign/new/info": {}, + "/activity/betDraw/info": {}, + "/activity/betDraw/record": {}, + "/activity/activityPopup/info": {}, } ) diff --git a/modules/web/routers/routers_activity.go b/modules/web/routers/routers_activity.go index 9c412cf..2157cba 100644 --- a/modules/web/routers/routers_activity.go +++ b/modules/web/routers/routers_activity.go @@ -43,4 +43,6 @@ func activity(e *gin.RouterGroup) { e.POST("/activity/betDraw/info", handler.ActivityBetDrawInfo) e.POST("/activity/betDraw/draw", handler.ActivityBetDrawDraw) e.POST("/activity/betDraw/record", handler.ActivityBetDrawHistory) + // 活动弹窗 + e.POST("/activity/activityPopup/info", handler.ActivityPopup) } diff --git a/modules/web/values/activity.go b/modules/web/values/activity.go index eeb76ec..cd446d8 100644 --- a/modules/web/values/activity.go +++ b/modules/web/values/activity.go @@ -279,3 +279,11 @@ type ActivityBetDrawRecordResp struct { RecordList []*common.ESActivityBetDraw // 历史记录 SelfList []*common.ESActivityBetDraw // 个人记录 } + +type ActivityPopupReq struct { + JumpType int // 跳转类型 +} + +type ActivityPopupResp struct { + List []*common.ConfigActivityPopup +} diff --git a/modules/web/values/firstpage.go b/modules/web/values/firstpage.go index e48d969..ca2c57c 100644 --- a/modules/web/values/firstpage.go +++ b/modules/web/values/firstpage.go @@ -19,6 +19,7 @@ type FirstPageResp struct { Esport *common.ConfigGameList DownloadAppReward int64 ShowData ShowInfo // 首页头部展示 + CurrencyResource []*common.ConfigCurrencyResource } type ShowInfo struct { diff --git a/modules/web/values/pay.go b/modules/web/values/pay.go index 192d6ce..cd16a76 100644 --- a/modules/web/values/pay.go +++ b/modules/web/values/pay.go @@ -41,6 +41,7 @@ type RechargeReq struct { Amount int64 `json:"Amount"` PayChannel int ProductID int + Bonus bool } // RechargeHistoryReq 请求充值记录 @@ -125,6 +126,7 @@ type WithDrawInfoResp struct { Tips string Fees []int64 Bets []int64 + NeedBet int64 // 打码信息 } // WithdrawHistoryReq 请求退出记录 diff --git a/modules/web/values/protocol.go b/modules/web/values/protocol.go index 7f975d1..86e8cf3 100644 --- a/modules/web/values/protocol.go +++ b/modules/web/values/protocol.go @@ -33,9 +33,10 @@ type SysConfigResp struct { } type OneUserInfoVip struct { - Cashback int64 - Bonus int64 - WithdrawFee int64 + Cashback int64 + Bonus int64 + WithdrawFee int64 + WithdrawCount int } // Recharge 充值总额 -- 2.36.2