package guser import ( "fmt" "server/call" "server/common" "server/modules/backend/values" "server/modules/customer/app" "github.com/gin-gonic/gin" "github.com/liangdas/mqant/log" ) // 修改玩家金币 func EditGameUserGold(c *gin.Context) { a := app.NewApp(c) defer func() { a.Response() }() req := new(values.EditGameUserGoldReq) if !a.S(req) { return } //var ct common.CurrencyType //switch req.Type { //case 1: // ct = common.CurrencyTypeBindCash //case 2: // ct = common.CurrencyTypeCash //default: // a.Code = values.CodeParam // a.Msg = "非法请求类型" // return //} user, _ := call.GetUserXInfo(req.UID, "channel_id") _ = user _, err := call.UpdateCurrencyPro(&common.UpdateCurrency{ CurrencyBalance: &common.CurrencyBalance{ UID: req.UID, Event: common.CurrencyEventGM, Type: common.CurrencyINR, Value: req.Amount, ChannelID: user.ChannelID, //NeedBet: GetConfigCurrencyResourceNeedBet(common.CurrencyResourceBonus, conf.Reward), }, }) if err != nil { log.Error("err:%v", err) a.Code = values.CodeRetry return } a.RecordEdit(values.PowerGUser, fmt.Sprintf("修改玩家%v金币:%v", req.UID, req.Amount)) }