1
This commit is contained in:
parent
c50c47d979
commit
b279049d2d
@ -7,6 +7,14 @@
|
|||||||
"nft_image": "https://res2.counterfire.games/nft/home_meta/home.jpg",
|
"nft_image": "https://res2.counterfire.games/nft/home_meta/home.jpg",
|
||||||
"nft_external_link": "https://www.counterfire.games"
|
"nft_external_link": "https://www.counterfire.games"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "new_hero",
|
||||||
|
"nft_name": "COUNTERFIRE | Legacy Heroes",
|
||||||
|
"nft_symbol": "Heroes",
|
||||||
|
"nft_description": "The Legacy Heroes NFT collection grants access to play-to-earn (P2E) features in the Counter Fire game.",
|
||||||
|
"nft_image": "https://res2.counterfire.games/nft/home_meta/home.jpg",
|
||||||
|
"nft_external_link": "https://www.counterfire.games"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "gold_bullion",
|
"name": "gold_bullion",
|
||||||
"nft_name": "COUNTERFIRE | Gold Fusion Card",
|
"nft_name": "COUNTERFIRE | Gold Fusion Card",
|
||||||
|
@ -30,6 +30,23 @@ func (this *NftMetaApi) Hero(c *gin.Context) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *NftMetaApi) NewHero(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",
|
||||||
|
"net_id": netId,
|
||||||
|
"token_type": q5.ToString(jccommon.NFT_TYPE_CFHERO_NORMAL),
|
||||||
|
"token_id": tokenId,
|
||||||
|
},
|
||||||
|
func (rsp f5.HttpCliResponse) {
|
||||||
|
c.Data(200, "application/json", []byte(rsp.GetRawData()))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (this *NftMetaApi) GoldBullion(c *gin.Context) {
|
func (this *NftMetaApi) GoldBullion(c *gin.Context) {
|
||||||
netId := c.Param("netId")
|
netId := c.Param("netId")
|
||||||
tokenId := c.Param("tokenId")
|
tokenId := c.Param("tokenId")
|
||||||
@ -48,6 +65,19 @@ func (this *NftMetaApi) GoldBullion(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *NftMetaApi) HeroHome(c *gin.Context) {
|
func (this *NftMetaApi) HeroHome(c *gin.Context) {
|
||||||
|
meta := mt.Table.NftHomeMeta.GetNewHeroMeta()
|
||||||
|
rspObj := new(common.NftHomeMeta)
|
||||||
|
if meta != nil {
|
||||||
|
rspObj.Name = meta.GetNftName()
|
||||||
|
rspObj.Symbol = meta.GetNftSymbol()
|
||||||
|
rspObj.Description = meta.GetNftDescription()
|
||||||
|
rspObj.Image = meta.GetNftImage()
|
||||||
|
rspObj.ExternalLink = meta.GetNftExternalLink()
|
||||||
|
}
|
||||||
|
c.JSON(200, rspObj)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *NftMetaApi) NewHeroHome(c *gin.Context) {
|
||||||
meta := mt.Table.NftHomeMeta.GetHeroMeta()
|
meta := mt.Table.NftHomeMeta.GetHeroMeta()
|
||||||
rspObj := new(common.NftHomeMeta)
|
rspObj := new(common.NftHomeMeta)
|
||||||
if meta != nil {
|
if meta != nil {
|
||||||
|
@ -12,6 +12,7 @@ type NftHomeMeta struct {
|
|||||||
type NftHomeMetaTable struct {
|
type NftHomeMetaTable struct {
|
||||||
f5.NameMetaTable[NftHomeMeta]
|
f5.NameMetaTable[NftHomeMeta]
|
||||||
hero *NftHomeMeta
|
hero *NftHomeMeta
|
||||||
|
newHero *NftHomeMeta
|
||||||
goldBullion *NftHomeMeta
|
goldBullion *NftHomeMeta
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,11 +20,16 @@ func (this *NftHomeMetaTable) GetHeroMeta() *NftHomeMeta {
|
|||||||
return this.hero
|
return this.hero
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *NftHomeMetaTable) GetNewHeroMeta() *NftHomeMeta {
|
||||||
|
return this.newHero
|
||||||
|
}
|
||||||
|
|
||||||
func (this *NftHomeMetaTable) GetGoldBullionMeta() *NftHomeMeta {
|
func (this *NftHomeMetaTable) GetGoldBullionMeta() *NftHomeMeta {
|
||||||
return this.goldBullion
|
return this.goldBullion
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *NftHomeMetaTable) PostInit1() {
|
func (this *NftHomeMetaTable) PostInit1() {
|
||||||
this.hero = this.GetByName("hero")
|
this.hero = this.GetByName("hero")
|
||||||
|
this.newHero = this.GetByName("new_hero")
|
||||||
this.goldBullion = this.GetByName("gold_bullion")
|
this.goldBullion = this.GetByName("gold_bullion")
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,9 @@ type NftMetaRouter struct{}
|
|||||||
func (this *NftMetaRouter) InitRouter() {
|
func (this *NftMetaRouter) InitRouter() {
|
||||||
api := v1.ApiGroupApp.NftApiGroup
|
api := v1.ApiGroupApp.NftApiGroup
|
||||||
f5.GetApp().GetGinEngine().GET("/hero/meta/:netId/:tokenId", api.NftMetaApi.Hero)
|
f5.GetApp().GetGinEngine().GET("/hero/meta/:netId/:tokenId", api.NftMetaApi.Hero)
|
||||||
|
f5.GetApp().GetGinEngine().GET("/newhero/meta/:netId/:tokenId", api.NftMetaApi.NewHero)
|
||||||
f5.GetApp().GetGinEngine().GET("/gold_bullion/meta/:netId/:tokenId", api.NftMetaApi.GoldBullion)
|
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("/hero/home_meta/:netId", api.NftMetaApi.HeroHome)
|
||||||
|
f5.GetApp().GetGinEngine().GET("/new/hero/home_meta/:netId", api.NftMetaApi.NewHeroHome)
|
||||||
f5.GetApp().GetGinEngine().GET("/gold_bullion/home_meta/:netId", api.NftMetaApi.GoldBullionHome)
|
f5.GetApp().GetGinEngine().GET("/gold_bullion/home_meta/:netId", api.NftMetaApi.GoldBullionHome)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user