This commit is contained in:
aozhiwei 2024-06-06 11:38:29 +08:00
parent 6783b73b53
commit 455120c7ca
2 changed files with 29 additions and 28 deletions

View File

@ -3,6 +3,7 @@ package nft
import (
"f5"
"mt"
"main/common"
"github.com/gin-gonic/gin"
)
@ -45,35 +46,27 @@ func (this *NftMetaApi) GoldBullion(c *gin.Context) {
}
func (this *NftMetaApi) HeroHome(c *gin.Context) {
netId := c.Param("netId")
tokenId := c.Param("tokenId")
f5.GetHttpCliMgr().SendGoStyleRequest(
mt.Table.Config.GetGameApiUrl(),
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())
})
meta := mt.Table.NftHomeMeta.GetHeroMeta()
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) GoldBullionHome(c *gin.Context) {
netId := c.Param("netId")
tokenId := c.Param("tokenId")
f5.GetHttpCliMgr().SendGoStyleRequest(
mt.Table.Config.GetGameApiUrl(),
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())
})
meta := mt.Table.NftHomeMeta.GetGoldBullionMeta()
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)
}

View File

@ -3,6 +3,14 @@ package common
import (
)
type NftHomeMeta struct {
Name string `json:"name"`
Symbol string `json:"symbol"`
Description string `json:"description"`
Image string `json:"image"`
ExternalLink string `json:"external_link"`
}
type App interface {
Run(func(), func())
}