1
This commit is contained in:
parent
a3ee1e4b1f
commit
1954eb4971
@ -7,6 +7,7 @@ import (
|
|||||||
"main/api/v1/gold_bullion"
|
"main/api/v1/gold_bullion"
|
||||||
"main/api/v1/shopcart"
|
"main/api/v1/shopcart"
|
||||||
"main/api/v1/nft"
|
"main/api/v1/nft"
|
||||||
|
"main/api/v1/ingame"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ApiGroup struct {
|
type ApiGroup struct {
|
||||||
@ -16,6 +17,7 @@ type ApiGroup struct {
|
|||||||
GoldBullionApiGroup gold_bullion.ApiGroup
|
GoldBullionApiGroup gold_bullion.ApiGroup
|
||||||
ShopCartApiGroup shopcart.ApiGroup
|
ShopCartApiGroup shopcart.ApiGroup
|
||||||
NftApiGroup nft.ApiGroup
|
NftApiGroup nft.ApiGroup
|
||||||
|
InGameApiGroup ingame.ApiGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
var ApiGroupApp = new(ApiGroup)
|
var ApiGroupApp = new(ApiGroup)
|
||||||
|
5
server/marketserver/api/v1/ingame/enter.go
Normal file
5
server/marketserver/api/v1/ingame/enter.go
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package ingame
|
||||||
|
|
||||||
|
type ApiGroup struct {
|
||||||
|
InGameApi
|
||||||
|
}
|
40
server/marketserver/api/v1/ingame/ingame.go
Normal file
40
server/marketserver/api/v1/ingame/ingame.go
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
package ingame
|
||||||
|
|
||||||
|
import (
|
||||||
|
"f5"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
type InGameApi struct {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *InGameApi) HeroList(c *gin.Context) {
|
||||||
|
reqJson := struct {
|
||||||
|
NetId interface{} `json:"net_id"`
|
||||||
|
ContractAddress string `json:"contract_address"`
|
||||||
|
To string `json:"to"`
|
||||||
|
Tokens struct {
|
||||||
|
TokenId string `json:"token_id"`
|
||||||
|
} `json:"tokens"`
|
||||||
|
}{}
|
||||||
|
if err := c.ShouldBindJSON(&reqJson); err != nil {
|
||||||
|
f5.RspErr(c, 401, "params parse error")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *InGameApi) HeroMint(c *gin.Context) {
|
||||||
|
reqJson := struct {
|
||||||
|
NetId interface{} `json:"net_id"`
|
||||||
|
ContractAddress string `json:"contract_address"`
|
||||||
|
To string `json:"to"`
|
||||||
|
Tokens struct {
|
||||||
|
TokenId string `json:"token_id"`
|
||||||
|
} `json:"tokens"`
|
||||||
|
}{}
|
||||||
|
if err := c.ShouldBindJSON(&reqJson); err != nil {
|
||||||
|
f5.RspErr(c, 401, "params parse error")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
5
server/marketserver/router/ingame/enter.go
Normal file
5
server/marketserver/router/ingame/enter.go
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package ingame
|
||||||
|
|
||||||
|
type RouterGroup struct {
|
||||||
|
IngameRouter
|
||||||
|
}
|
14
server/marketserver/router/ingame/ingame.go
Normal file
14
server/marketserver/router/ingame/ingame.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package ingame
|
||||||
|
|
||||||
|
import (
|
||||||
|
"f5"
|
||||||
|
"main/api/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
type IngameRouter struct{}
|
||||||
|
|
||||||
|
func (this *IngameRouter) InitRouter() {
|
||||||
|
api := v1.ApiGroupApp.IngameApiGroup
|
||||||
|
f5.GetApp().GetGinEngine().GET("/api/ingame/asset/hero/list", api.IngameApi.HeroList)
|
||||||
|
f5.GetApp().GetGinEngine().POST("/api/ingame/asset/hero/mint", api.IngameApi.HeroMint)
|
||||||
|
}
|
@ -9,5 +9,5 @@ type NftRouter struct{}
|
|||||||
|
|
||||||
func (this *NftRouter) InitRouter() {
|
func (this *NftRouter) InitRouter() {
|
||||||
api := v1.ApiGroupApp.NftApiGroup
|
api := v1.ApiGroupApp.NftApiGroup
|
||||||
f5.GetApp().GetGinEngine().GET("/api/nft/stacking/unlock", api.NftApi.Unlock)
|
f5.GetApp().GetGinEngine().POST("/api/nft/stacking/unlock", api.NftApi.Unlock)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user