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
import (
"main/constant"
"q5"
"f5"
"mt"
"jccommon"
"github.com/gin-gonic/gin"
)
@ -15,18 +15,19 @@ 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)
/*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": "nftDetail",
"contract_address": contractAddress,
//"contract_address": contractAddress,
"net_id": q5.ToString(netId),
"token_type": q5.ToString(jccommon.NFT_TYPE_CFHERO),
"token_id": tokenId,
},
func (rsp f5.HttpCliResponse) {
@ -37,18 +38,20 @@ func (this *NftDetailApi) Hero(c *gin.Context) {
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": "nftDetail",
"contract_address": contractAddress,
//"contract_address": contractAddress,
"net_id": q5.ToString(netId),
"token_type": q5.ToString(jccommon.NFT_TYPE_GOLD_BULLION),
"token_id": tokenId,
},
func (rsp f5.HttpCliResponse) {

View File

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

View File

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