This commit is contained in:
aozhiwei 2024-06-22 17:11:05 +08:00
parent a8047eaada
commit 530c9005f9
3 changed files with 15 additions and 8 deletions

View File

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

View File

@ -6,6 +6,8 @@ require q5 v1.0.0
require f5 v1.0.0 require f5 v1.0.0
require jccommon v1.0.0
require mt v1.0.0 require mt v1.0.0
require ( require (
@ -59,6 +61,8 @@ replace q5 => ../../third_party/q5
replace f5 => ../../third_party/f5 replace f5 => ../../third_party/f5
replace jccommon => ../jccommon
replace mt => ./mt replace mt => ./mt
replace mtb => ./mtb replace mtb => ./mtb

View File

@ -9,7 +9,7 @@ type table struct {
NftDb *NftDbTable NftDb *NftDbTable
Config *ConfigTable Config *ConfigTable
NftHomeMeta *NftHomeMetaTable NftHomeMeta *NftHomeMetaTable
Contract *ContractTable //Contract *ContractTable
} }
var Table = f5.New(func(this *table) { var Table = f5.New(func(this *table) {
@ -33,6 +33,6 @@ var Table = f5.New(func(this *table) {
this.PrimKey = "name" this.PrimKey = "name"
}) })
this.Contract = new(ContractTable) //this.Contract = new(ContractTable)
}) })