package nft import ( "q5" "f5" "main/mt" "jccommon" "github.com/gin-gonic/gin" ) type NftDetailApi struct { } func (this *NftDetailApi) Hero(c *gin.Context) { netId := q5.ToInt32(c.Param("netId")) tokenId := c.Param("tokenId") /*contractMeta := mt.Table.Contract.GetByNetIdName(netId, constant.CONTRACT_NAME_CFHero) contractAddress := "" if contractMeta != nil { contractAddress = contractMeta.GetAddress() }*/ f5.GetHttpCliMgr().SendGoStyleRequest( mt.Table.Config.GetGameApiUrl() + "/webapp/index.php", map[string]string{ "c": "OutAppNft", "a": "nftDetailByTokenType", //"contract_address": contractAddress, "net_id": q5.ToString(netId), "token_type": q5.ToString(jccommon.NFT_TYPE_CFHERO), "token_id": tokenId, }, func (rsp f5.HttpCliResponse) { c.Data(200, "application/json", []byte(rsp.GetRawData())) //c.String(200, rsp.GetRawData()) }) } func (this *NftDetailApi) GoldBullion(c *gin.Context) { netId := q5.ToInt32(c.Param("netId")) tokenId := c.Param("tokenId") /* contractMeta := mt.Table.Contract.GetByNetIdName(netId, constant.CONTRACT_NAME_GoldBrick) contractAddress := "" if contractMeta != nil { contractAddress = contractMeta.GetAddress() }*/ f5.GetHttpCliMgr().SendGoStyleRequest( mt.Table.Config.GetGameApiUrl() + "/webapp/index.php", map[string]string{ "c": "OutAppNft", "a": "nftDetailByTokenType", //"contract_address": contractAddress, "net_id": q5.ToString(netId), "token_type": q5.ToString(jccommon.NFT_TYPE_GOLD_BULLION), "token_id": tokenId, }, func (rsp f5.HttpCliResponse) { c.Data(200, "application/json", []byte(rsp.GetRawData())) }) }