1
This commit is contained in:
parent
103ac706ff
commit
a3ee1e4b1f
@ -6,6 +6,7 @@ import (
|
|||||||
"main/api/v1/hero"
|
"main/api/v1/hero"
|
||||||
"main/api/v1/gold_bullion"
|
"main/api/v1/gold_bullion"
|
||||||
"main/api/v1/shopcart"
|
"main/api/v1/shopcart"
|
||||||
|
"main/api/v1/nft"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ApiGroup struct {
|
type ApiGroup struct {
|
||||||
@ -14,6 +15,7 @@ type ApiGroup struct {
|
|||||||
HeroApiGroup hero.ApiGroup
|
HeroApiGroup hero.ApiGroup
|
||||||
GoldBullionApiGroup gold_bullion.ApiGroup
|
GoldBullionApiGroup gold_bullion.ApiGroup
|
||||||
ShopCartApiGroup shopcart.ApiGroup
|
ShopCartApiGroup shopcart.ApiGroup
|
||||||
|
NftApiGroup nft.ApiGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
var ApiGroupApp = new(ApiGroup)
|
var ApiGroupApp = new(ApiGroup)
|
||||||
|
5
server/marketserver/api/v1/nft/enter.go
Normal file
5
server/marketserver/api/v1/nft/enter.go
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package nft
|
||||||
|
|
||||||
|
type ApiGroup struct {
|
||||||
|
NftApi
|
||||||
|
}
|
25
server/marketserver/api/v1/nft/nft.go
Normal file
25
server/marketserver/api/v1/nft/nft.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package nft
|
||||||
|
|
||||||
|
import (
|
||||||
|
"f5"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
type NftApi struct {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *NftApi) Unlock(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/nft/enter.go
Normal file
5
server/marketserver/router/nft/enter.go
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package nft
|
||||||
|
|
||||||
|
type RouterGroup struct {
|
||||||
|
NftRouter
|
||||||
|
}
|
13
server/marketserver/router/nft/nft.go
Normal file
13
server/marketserver/router/nft/nft.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package nft
|
||||||
|
|
||||||
|
import (
|
||||||
|
"f5"
|
||||||
|
"main/api/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
type NftRouter struct{}
|
||||||
|
|
||||||
|
func (this *NftRouter) InitRouter() {
|
||||||
|
api := v1.ApiGroupApp.NftApiGroup
|
||||||
|
f5.GetApp().GetGinEngine().GET("/api/nft/stacking/unlock", api.NftApi.Unlock)
|
||||||
|
}
|
@ -8,6 +8,7 @@ import (
|
|||||||
"main/router/hero"
|
"main/router/hero"
|
||||||
"main/router/gold_bullion"
|
"main/router/gold_bullion"
|
||||||
"main/router/shopcart"
|
"main/router/shopcart"
|
||||||
|
"main/router/nft"
|
||||||
)
|
)
|
||||||
|
|
||||||
type routerMgr struct {
|
type routerMgr struct {
|
||||||
@ -16,6 +17,7 @@ type routerMgr struct {
|
|||||||
hero hero.RouterGroup
|
hero hero.RouterGroup
|
||||||
goldBullion gold_bullion.RouterGroup
|
goldBullion gold_bullion.RouterGroup
|
||||||
shopCart shopcart.RouterGroup
|
shopCart shopcart.RouterGroup
|
||||||
|
nft nft.RouterGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *routerMgr) Init() {
|
func (this *routerMgr) Init() {
|
||||||
@ -25,6 +27,7 @@ func (this *routerMgr) Init() {
|
|||||||
this.hero.HeroRouter.InitRouter()
|
this.hero.HeroRouter.InitRouter()
|
||||||
this.goldBullion.GoldBullionRouter.InitRouter()
|
this.goldBullion.GoldBullionRouter.InitRouter()
|
||||||
this.shopCart.ShopCartRouter.InitRouter()
|
this.shopCart.ShopCartRouter.InitRouter()
|
||||||
|
this.nft.NftRouter.InitRouter()
|
||||||
|
|
||||||
f5.GetSysLog().Info("routerMgr.init")
|
f5.GetSysLog().Info("routerMgr.init")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user