vip bind & vipuser
This commit is contained in:
parent
9b0fa4e908
commit
e09b1f18f6
@ -210,7 +210,7 @@ func (pai *PlayerApi) HeroesQuery(c *gin.Context) {
|
|||||||
sql += "'" + addr + "',"
|
sql += "'" + addr + "',"
|
||||||
}
|
}
|
||||||
sql = sql[:len(sql)-1]
|
sql = sql[:len(sql)-1]
|
||||||
sql+="))"
|
sql += "))"
|
||||||
}
|
}
|
||||||
sql += ")"
|
sql += ")"
|
||||||
f5.GetSysLog().Debug("tokenid sql:%s", sql)
|
f5.GetSysLog().Debug("tokenid sql:%s", sql)
|
||||||
@ -358,10 +358,7 @@ func (pai *PlayerApi) RechargeQuery(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(reqJson.Identity) > 0xFF {
|
if len(reqJson.Identity) > 0xFF {
|
||||||
c.JSON(http.StatusOK, gin.H{
|
f5.RspErr2(c, 1, "输入过长")
|
||||||
"code": 1,
|
|
||||||
"message": "输入过长",
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,3 +376,106 @@ func (pai *PlayerApi) RechargeQuery(c *gin.Context) {
|
|||||||
return p
|
return p
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (pai *PlayerApi) VipBindQuery(c *gin.Context) {
|
||||||
|
type VipBindQueryForm struct {
|
||||||
|
Identity string `binding:"required" json:"identity"`
|
||||||
|
}
|
||||||
|
|
||||||
|
reqJson := VipBindQueryForm{}
|
||||||
|
if !checkparam(&reqJson, c) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(reqJson.Identity) > 0xFF {
|
||||||
|
f5.RspErr2(c, 1, "输入过长")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
rsp := []struct {
|
||||||
|
Account string `gorm:"column:account_address" json:"account_address"`
|
||||||
|
Passport string `gorm:"column:passport_address" json:"passport_address"`
|
||||||
|
Email string `gorm:"column:lower_case_email" json:"lower_case_email"`
|
||||||
|
}{}
|
||||||
|
|
||||||
|
sql := `SELECT * FROM t_vip_bind WHERE idx > 0 AND (account_address = ? OR passport_address = ?)`
|
||||||
|
f5.GetGoStyleDb().RawQuery(
|
||||||
|
constant.BCNFT_DB,
|
||||||
|
sql,
|
||||||
|
[]string{
|
||||||
|
reqJson.Identity,
|
||||||
|
reqJson.Identity,
|
||||||
|
},
|
||||||
|
func(err error, ds *f5.DataSet) {
|
||||||
|
if err != nil {
|
||||||
|
f5.RspErr2(c, 500, "server internal error")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for ds.Next() {
|
||||||
|
p := q5.NewSliceElement(&rsp)
|
||||||
|
f5.UnmarshalModel(ds, p)
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"code": 0,
|
||||||
|
"message": "",
|
||||||
|
"data": rsp,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (pai *PlayerApi) VipUserQuery(c *gin.Context) {
|
||||||
|
type VipUserQueryForm struct {
|
||||||
|
Account string `binding:"required" json:"account_address"`
|
||||||
|
}
|
||||||
|
|
||||||
|
reqJson := VipUserQueryForm{}
|
||||||
|
if !checkparam(&reqJson, c) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(reqJson.Account) > 0xFF {
|
||||||
|
f5.RspErr2(c, 1, "输入过长")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
rsp := []struct {
|
||||||
|
Account string `gorm:"column:account_address" json:"account_address"`
|
||||||
|
Level int64 `gorm:"column:vip_lv" json:"vip_lv"`
|
||||||
|
Balance string `gorm:"column:escec_balance" json:"escec_balance"`
|
||||||
|
Stacking string `gorm:"column:escec_stacking" json:"escec_stacking"`
|
||||||
|
Convert string `gorm:"column:escec_convert" json:"escec_convert"`
|
||||||
|
Total string `gorm:"column:escec_total" json:"escec_total"`
|
||||||
|
StackingLast int64 `gorm:"column:stacking_last_src_idx" json:"stacking_last_src_idx"`
|
||||||
|
TransferLast int64 `gorm:"column:escec_transfer_last_src_idx" json:"escec_transfer_last_src_idx"`
|
||||||
|
DepositLast int64 `gorm:"column:vester_deposit_last_src_idx" json:"vester_deposit_last_src_idx"`
|
||||||
|
WithdrawLast int64 `gorm:"column:vester_withdraw_last_src_idx" json:"vester_withdraw_last_src_idx"`
|
||||||
|
}{}
|
||||||
|
|
||||||
|
sql := `SELECT * FROM t_vip_user WHERE idx > 0 AND account_address = ?`
|
||||||
|
f5.GetGoStyleDb().RawQuery(
|
||||||
|
constant.BCNFT_DB,
|
||||||
|
sql,
|
||||||
|
[]string{
|
||||||
|
reqJson.Account,
|
||||||
|
},
|
||||||
|
func(err error, ds *f5.DataSet) {
|
||||||
|
if err != nil {
|
||||||
|
f5.RspErr2(c, 500, "server internal error")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for ds.Next() {
|
||||||
|
p := q5.NewSliceElement(&rsp)
|
||||||
|
f5.UnmarshalModel(ds, p)
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"code": 0,
|
||||||
|
"message": "",
|
||||||
|
"data": rsp,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -20,5 +20,7 @@ func (pr *PlayerRouter) InitPlayerRouter(priRouter *gin.RouterGroup) {
|
|||||||
group.POST("ticketconsumequery", middleware.Permission("api/v1/player/ticketconsumequery", api.TicketConsumeQuery))
|
group.POST("ticketconsumequery", middleware.Permission("api/v1/player/ticketconsumequery", api.TicketConsumeQuery))
|
||||||
group.POST("gamemallquery", middleware.Permission("api/v1/player/gamemallquery", api.GameMallQuery))
|
group.POST("gamemallquery", middleware.Permission("api/v1/player/gamemallquery", api.GameMallQuery))
|
||||||
group.POST("rechargequery", middleware.Permission("api/v1/player/rechargequery", api.RechargeQuery))
|
group.POST("rechargequery", middleware.Permission("api/v1/player/rechargequery", api.RechargeQuery))
|
||||||
|
group.POST("vipbindquery", middleware.Permission("api/v1/player/vipbindquery", api.VipBindQuery))
|
||||||
|
group.POST("vipuserquery", middleware.Permission("api/v1/player/vipuserquery", api.VipUserQuery))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user