1
This commit is contained in:
parent
b2c45ca99f
commit
edb09e4e32
@ -2,4 +2,5 @@ package nft
|
||||
|
||||
type ApiGroup struct {
|
||||
NftMetaApi
|
||||
NftDetailApi
|
||||
}
|
||||
|
45
server/nftserver/api/v1/nft/nftdetail.go
Normal file
45
server/nftserver/api/v1/nft/nftdetail.go
Normal file
@ -0,0 +1,45 @@
|
||||
package nft
|
||||
|
||||
import (
|
||||
"f5"
|
||||
"mt"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type NftDetailApi struct {
|
||||
|
||||
}
|
||||
|
||||
func (this *NftDetailApi) Hero(c *gin.Context) {
|
||||
netId := c.Param("netId")
|
||||
tokenId := c.Param("tokenId")
|
||||
f5.GetHttpCliMgr().SendGoStyleRequest(
|
||||
mt.Table.Config.GetGameApiUrl() + "/webapp/index.php",
|
||||
map[string]string{
|
||||
"c": "OutAppNft",
|
||||
"a": "nftMetaView",
|
||||
"nft_type": "hero",
|
||||
"net_id": netId,
|
||||
"token_id": tokenId,
|
||||
},
|
||||
func (rsp f5.HttpCliResponse) {
|
||||
c.String(200, rsp.GetRawData())
|
||||
})
|
||||
}
|
||||
|
||||
func (this *NftDetailApi) GoldBullion(c *gin.Context) {
|
||||
netId := c.Param("netId")
|
||||
tokenId := c.Param("tokenId")
|
||||
f5.GetHttpCliMgr().SendGoStyleRequest(
|
||||
mt.Table.Config.GetGameApiUrl() + "/webapp/index.php",
|
||||
map[string]string{
|
||||
"c": "OutAppNft",
|
||||
"a": "nftMetaView",
|
||||
"nft_type": "gold_bullion",
|
||||
"net_id": netId,
|
||||
"token_id": tokenId,
|
||||
},
|
||||
func (rsp f5.HttpCliResponse) {
|
||||
c.String(200, rsp.GetRawData())
|
||||
})
|
||||
}
|
@ -2,4 +2,5 @@ package nft
|
||||
|
||||
type RouterGroup struct {
|
||||
NftMetaRouter
|
||||
NftDetailRouter
|
||||
}
|
||||
|
14
server/nftserver/router/nft/nftdetail.go
Normal file
14
server/nftserver/router/nft/nftdetail.go
Normal file
@ -0,0 +1,14 @@
|
||||
package nft
|
||||
|
||||
import (
|
||||
"f5"
|
||||
"main/api/v1"
|
||||
)
|
||||
|
||||
type NftDetailRouter struct{}
|
||||
|
||||
func (this *NftDetailRouter) InitRouter() {
|
||||
api := v1.ApiGroupApp.NftApiGroup
|
||||
f5.GetApp().GetGinEngine().GET("/hero/detail/:netId/:tokenId", api.NftDetailApi.Hero)
|
||||
f5.GetApp().GetGinEngine().GET("/gold_bullion/detail/:netId/:tokenId", api.NftDetailApi.GoldBullion)
|
||||
}
|
@ -9,8 +9,8 @@ type NftMetaRouter struct{}
|
||||
|
||||
func (this *NftMetaRouter) InitRouter() {
|
||||
api := v1.ApiGroupApp.NftApiGroup
|
||||
f5.GetApp().GetGinEngine().GET("hero/meta/:netId/:tokenId", api.NftMetaApi.Hero)
|
||||
f5.GetApp().GetGinEngine().GET("gold_bullion/meta/:netId/:tokenId", api.NftMetaApi.GoldBullion)
|
||||
f5.GetApp().GetGinEngine().GET("hero/home_meta/:netId", api.NftMetaApi.HeroHome)
|
||||
f5.GetApp().GetGinEngine().GET("gold_bullion/home_meta/:netId", api.NftMetaApi.GoldBullionHome)
|
||||
f5.GetApp().GetGinEngine().GET("/hero/meta/:netId/:tokenId", api.NftMetaApi.Hero)
|
||||
f5.GetApp().GetGinEngine().GET("/gold_bullion/meta/:netId/:tokenId", api.NftMetaApi.GoldBullion)
|
||||
f5.GetApp().GetGinEngine().GET("/hero/home_meta/:netId", api.NftMetaApi.HeroHome)
|
||||
f5.GetApp().GetGinEngine().GET("/gold_bullion/home_meta/:netId", api.NftMetaApi.GoldBullionHome)
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ func (this *routerMgr) Init() {
|
||||
this.ca.InitServerSwitchRouter()
|
||||
|
||||
this.nft.NftMetaRouter.InitRouter()
|
||||
this.nft.NftDetailRouter.InitRouter()
|
||||
|
||||
f5.GetSysLog().Info("routerMgr.init")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user