1
This commit is contained in:
parent
ee7707286f
commit
2bc17d7a2e
@ -45,7 +45,7 @@ func (ea *RechargeApi) RechargeList(c *gin.Context) {
|
|||||||
func (this *RechargeApi) Pay(c *gin.Context) {
|
func (this *RechargeApi) Pay(c *gin.Context) {
|
||||||
reqJson := struct {
|
reqJson := struct {
|
||||||
NetId int32 `json:"net_id"`
|
NetId int32 `json:"net_id"`
|
||||||
GoodsId string `json:"goods_id"`
|
GoodsId int32 `json:"goods_id"`
|
||||||
AccountAddress string `json:"account_address"`
|
AccountAddress string `json:"account_address"`
|
||||||
} {}
|
} {}
|
||||||
if err := c.ShouldBindJSON(&reqJson); err != nil {
|
if err := c.ShouldBindJSON(&reqJson); err != nil {
|
||||||
@ -55,6 +55,11 @@ func (this *RechargeApi) Pay(c *gin.Context) {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
goodsMeta := mt.Table.Recharge.GetById(q5.ToInt64(reqJson.GoodsId))
|
||||||
|
if goodsMeta == nil {
|
||||||
|
f5.RspErr(c, 2, "goods id param error")
|
||||||
|
return
|
||||||
|
}
|
||||||
orderId := q5.ToString(f5.GetApp().NewLockNodeUuid())
|
orderId := q5.ToString(f5.GetApp().NewLockNodeUuid())
|
||||||
params := map[string]string{
|
params := map[string]string{
|
||||||
"c" : "BcService",
|
"c" : "BcService",
|
||||||
|
@ -10,5 +10,5 @@ type Recharge struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RechargeTable struct {
|
type RechargeTable struct {
|
||||||
f5.NameMetaTable[Recharge]
|
f5.IdMetaTable[Recharge]
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package recharge
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"f5"
|
"f5"
|
||||||
|
"main/middleware"
|
||||||
v1 "main/api/v1"
|
v1 "main/api/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -11,5 +12,5 @@ func (er *RechargeRouter) InitRouter() {
|
|||||||
api := v1.ApiGroupApp.RechargeApiGroup
|
api := v1.ApiGroupApp.RechargeApiGroup
|
||||||
f5.GetApp().GetGinEngine().GET("/api/recharge/history/:account_address", api.RechargeApi.RechargeQuery)
|
f5.GetApp().GetGinEngine().GET("/api/recharge/history/:account_address", api.RechargeApi.RechargeQuery)
|
||||||
f5.GetApp().GetGinEngine().GET("/api/recharge/goods", api.RechargeApi.RechargeList)
|
f5.GetApp().GetGinEngine().GET("/api/recharge/goods", api.RechargeApi.RechargeList)
|
||||||
f5.GetApp().GetGinEngine().GET("/api/recharge/pay", api.RechargeApi.Pay)
|
f5.GetApp().GetGinEngine().POST("/api/recharge/pay", middleware.JwtAuth, api.RechargeApi.Pay)
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ type LoginRsp struct {
|
|||||||
ValidLefttime interface{} `json:"valid_lefttime"`
|
ValidLefttime interface{} `json:"valid_lefttime"`
|
||||||
CurrentTimes interface{} `json:"current_times"`
|
CurrentTimes interface{} `json:"current_times"`
|
||||||
TotalTimes interface{} `json:"total_times"`
|
TotalTimes interface{} `json:"total_times"`
|
||||||
|
SkinId interface{} `json:"skin_id"`
|
||||||
} `json:"hero_info"`
|
} `json:"hero_info"`
|
||||||
MapInfo *MapInfoRsp `json:"map_info"`
|
MapInfo *MapInfoRsp `json:"map_info"`
|
||||||
} `json:"info"`
|
} `json:"info"`
|
||||||
@ -63,6 +64,7 @@ type UserRsp struct {
|
|||||||
ValidLefttime interface{} `json:"valid_lefttime"`
|
ValidLefttime interface{} `json:"valid_lefttime"`
|
||||||
CurrentTimes interface{} `json:"current_times"`
|
CurrentTimes interface{} `json:"current_times"`
|
||||||
TotalTimes interface{} `json:"total_times"`
|
TotalTimes interface{} `json:"total_times"`
|
||||||
|
SkinId interface{} `json:"skin_id"`
|
||||||
} `json:"hero_info"`
|
} `json:"hero_info"`
|
||||||
} `json:"info"`
|
} `json:"info"`
|
||||||
}
|
}
|
||||||
@ -110,6 +112,7 @@ type UpdateBattleInfoRsp struct {
|
|||||||
ValidLefttime interface{} `json:"valid_lefttime"`
|
ValidLefttime interface{} `json:"valid_lefttime"`
|
||||||
CurrentTimes interface{} `json:"current_times"`
|
CurrentTimes interface{} `json:"current_times"`
|
||||||
TotalTimes interface{} `json:"total_times"`
|
TotalTimes interface{} `json:"total_times"`
|
||||||
|
SkinId interface{} `json:"skin_id"`
|
||||||
} `json:"hero_info"`
|
} `json:"hero_info"`
|
||||||
} `json:"info"`
|
} `json:"info"`
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ type hero struct {
|
|||||||
validLeftTime int32
|
validLeftTime int32
|
||||||
currentTimes int32
|
currentTimes int32
|
||||||
totalTimes int32
|
totalTimes int32
|
||||||
|
skinId int32
|
||||||
}
|
}
|
||||||
|
|
||||||
type player struct {
|
type player struct {
|
||||||
@ -70,6 +71,7 @@ func (this *player) init(req *pendingLoginRequest, rsp *common.LoginRsp){
|
|||||||
q5.DuckToSimple(rsp.Info.HeroInfo.ValidLefttime, &this.hero.validLeftTime)
|
q5.DuckToSimple(rsp.Info.HeroInfo.ValidLefttime, &this.hero.validLeftTime)
|
||||||
q5.DuckToSimple(rsp.Info.HeroInfo.CurrentTimes, &this.hero.currentTimes)
|
q5.DuckToSimple(rsp.Info.HeroInfo.CurrentTimes, &this.hero.currentTimes)
|
||||||
q5.DuckToSimple(rsp.Info.HeroInfo.TotalTimes, &this.hero.totalTimes)
|
q5.DuckToSimple(rsp.Info.HeroInfo.TotalTimes, &this.hero.totalTimes)
|
||||||
|
q5.DuckToSimple(rsp.Info.HeroInfo.SkinId, &this.hero.skinId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,6 +95,7 @@ func (this *player) againInit(req *pendingLoginRequest, rsp *common.LoginRsp){
|
|||||||
q5.DuckToSimple(rsp.Info.HeroInfo.ValidLefttime, &this.hero.validLeftTime)
|
q5.DuckToSimple(rsp.Info.HeroInfo.ValidLefttime, &this.hero.validLeftTime)
|
||||||
q5.DuckToSimple(rsp.Info.HeroInfo.CurrentTimes, &this.hero.currentTimes)
|
q5.DuckToSimple(rsp.Info.HeroInfo.CurrentTimes, &this.hero.currentTimes)
|
||||||
q5.DuckToSimple(rsp.Info.HeroInfo.TotalTimes, &this.hero.totalTimes)
|
q5.DuckToSimple(rsp.Info.HeroInfo.TotalTimes, &this.hero.totalTimes)
|
||||||
|
q5.DuckToSimple(rsp.Info.HeroInfo.SkinId, &this.hero.skinId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,6 +220,7 @@ func (this *player) FillMFTeamMember(member_pb *cs.MFTeamMember) {
|
|||||||
member_pb.Hero.Quality = proto.Int32(this.hero.quality)
|
member_pb.Hero.Quality = proto.Int32(this.hero.quality)
|
||||||
member_pb.Hero.CurrentTimes = proto.Int32(this.hero.currentTimes)
|
member_pb.Hero.CurrentTimes = proto.Int32(this.hero.currentTimes)
|
||||||
member_pb.Hero.TotalTimes = proto.Int32(this.hero.totalTimes)
|
member_pb.Hero.TotalTimes = proto.Int32(this.hero.totalTimes)
|
||||||
|
member_pb.Hero.SkinId = proto.Int32(this.hero.skinId)
|
||||||
}
|
}
|
||||||
member_pb.State = proto.Int32(this.state)
|
member_pb.State = proto.Int32(this.state)
|
||||||
if this.IsOnline() {
|
if this.IsOnline() {
|
||||||
@ -434,6 +438,7 @@ func (this *player) CMRefreshUser(hdr *f5.MsgHdr, msg *cs.CMRefreshUser) {
|
|||||||
q5.DuckToSimple(rspObj.Info.HeroInfo.ValidLefttime, &this.hero.validLeftTime)
|
q5.DuckToSimple(rspObj.Info.HeroInfo.ValidLefttime, &this.hero.validLeftTime)
|
||||||
q5.DuckToSimple(rspObj.Info.HeroInfo.CurrentTimes, &this.hero.currentTimes)
|
q5.DuckToSimple(rspObj.Info.HeroInfo.CurrentTimes, &this.hero.currentTimes)
|
||||||
q5.DuckToSimple(rspObj.Info.HeroInfo.TotalTimes, &this.hero.totalTimes)
|
q5.DuckToSimple(rspObj.Info.HeroInfo.TotalTimes, &this.hero.totalTimes)
|
||||||
|
q5.DuckToSimple(rspObj.Info.HeroInfo.SkinId, &this.hero.skinId)
|
||||||
}
|
}
|
||||||
if this.GetTeam() != nil {
|
if this.GetTeam() != nil {
|
||||||
this.GetTeam().SendUpdateNotify()
|
this.GetTeam().SendUpdateNotify()
|
||||||
@ -486,6 +491,7 @@ func (this *player) updateChoose(skillId int32, heroUniId string,
|
|||||||
q5.DuckToSimple(rspObj.Info.HeroInfo.ValidLefttime, &this.hero.validLeftTime)
|
q5.DuckToSimple(rspObj.Info.HeroInfo.ValidLefttime, &this.hero.validLeftTime)
|
||||||
q5.DuckToSimple(rspObj.Info.HeroInfo.CurrentTimes, &this.hero.currentTimes)
|
q5.DuckToSimple(rspObj.Info.HeroInfo.CurrentTimes, &this.hero.currentTimes)
|
||||||
q5.DuckToSimple(rspObj.Info.HeroInfo.TotalTimes, &this.hero.totalTimes)
|
q5.DuckToSimple(rspObj.Info.HeroInfo.TotalTimes, &this.hero.totalTimes)
|
||||||
|
q5.DuckToSimple(rspObj.Info.HeroInfo.SkinId, &this.hero.skinId)
|
||||||
}
|
}
|
||||||
cb(0, "")
|
cb(0, "")
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ message MFHero
|
|||||||
optional int32 quality = 2; //英雄品阶
|
optional int32 quality = 2; //英雄品阶
|
||||||
optional int32 current_times = 3; //当前打金次数
|
optional int32 current_times = 3; //当前打金次数
|
||||||
optional int32 total_times = 4; //总打金次数
|
optional int32 total_times = 4; //总打金次数
|
||||||
|
optional int32 skin_id = 5; //皮肤id
|
||||||
}
|
}
|
||||||
|
|
||||||
//加入房间消息
|
//加入房间消息
|
||||||
|
@ -56,6 +56,7 @@ func (this* robot) FillMFTeamMember(member_pb *cs.MFTeamMember) {
|
|||||||
member_pb.Hero.Quality = proto.Int32(0)
|
member_pb.Hero.Quality = proto.Int32(0)
|
||||||
member_pb.Hero.CurrentTimes = proto.Int32(0)
|
member_pb.Hero.CurrentTimes = proto.Int32(0)
|
||||||
member_pb.Hero.TotalTimes = proto.Int32(0)
|
member_pb.Hero.TotalTimes = proto.Int32(0)
|
||||||
|
member_pb.Hero.SkinId = proto.Int32(0)
|
||||||
}
|
}
|
||||||
member_pb.State = proto.Int32(0)
|
member_pb.State = proto.Int32(0)
|
||||||
member_pb.Online = proto.Int32(1)
|
member_pb.Online = proto.Int32(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user