This commit is contained in:
aozhiwei 2024-06-20 22:04:33 +08:00
parent ee7e7073c3
commit e7d4c139eb
6 changed files with 30 additions and 29 deletions

View File

@ -0,0 +1,18 @@
package mt
import (
"f5"
"mtb"
)
type Web3ServiceCluster struct {
mtb.Web3ServiceCluster
}
type Web3ServiceClusterTable struct {
f5.IdMetaTable[Web3ServiceCluster]
}
func (this *Web3ServiceCluster) Init1() {
}

View File

@ -1,18 +0,0 @@
package mt
import (
"f5"
"mtb"
)
type Web3SignCluster struct {
mtb.Web3SignCluster
}
type Web3SignClusterTable struct {
f5.IdMetaTable[Web3SignCluster]
}
func (this *Web3SignCluster) Init1() {
}

View File

@ -12,7 +12,7 @@ type table struct {
Config *ConfigTable Config *ConfigTable
Item *ItemTable Item *ItemTable
Contract *ContractTable Contract *ContractTable
Web3SignCluster *Web3SignClusterTable Web3ServiceCluster *Web3ServiceClusterTable
} }
var Table = f5.New(func(this *table) { var Table = f5.New(func(this *table) {
@ -51,8 +51,8 @@ var Table = f5.New(func(this *table) {
this.PrimKey = "name" this.PrimKey = "name"
}) })
this.Web3SignCluster = f5.New(func(this *Web3SignClusterTable) { this.Web3ServiceCluster = f5.New(func(this *Web3ServiceClusterTable) {
this.FileName = "../config/web3sign.cluster.json" this.FileName = "../config/web3service.cluster.json"
this.PrimKey = "" this.PrimKey = ""
}) })

View File

@ -69,7 +69,7 @@ type Contract struct {
_flags2_ uint64 _flags2_ uint64
} }
type Web3SignCluster struct { type Web3ServiceCluster struct {
url string url string
_flags1_ uint64 _flags1_ uint64
@ -260,11 +260,11 @@ func (this *Contract) HasAddress() bool {
return (this._flags1_ & (uint64(1) << 4)) > 0 return (this._flags1_ & (uint64(1) << 4)) > 0
} }
func (this *Web3SignCluster) GetUrl() string { func (this *Web3ServiceCluster) GetUrl() string {
return this.url return this.url
} }
func (this *Web3SignCluster) HasUrl() bool { func (this *Web3ServiceCluster) HasUrl() bool {
return (this._flags1_ & (uint64(1) << 1)) > 0 return (this._flags1_ & (uint64(1) << 1)) > 0
} }
@ -313,6 +313,6 @@ func (this *Contract) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.address, "address", &this._flags1_, 4, kv) f5.ReadMetaTableField(&this.address, "address", &this._flags1_, 4, kv)
} }
func (this *Web3SignCluster) LoadFromKv(kv map[string]interface{}) { func (this *Web3ServiceCluster) LoadFromKv(kv map[string]interface{}) {
f5.ReadMetaTableField(&this.url, "url", &this._flags1_, 1, kv) f5.ReadMetaTableField(&this.url, "url", &this._flags1_, 1, kv)
} }

View File

@ -53,7 +53,7 @@ message Contract
optional string address = 4; optional string address = 4;
} }
message Web3SignCluster message Web3ServiceCluster
{ {
optional string url = 1; optional string url = 1;
} }

View File

@ -3,8 +3,8 @@ package service
import ( import (
"q5" "q5"
"f5" "f5"
"mt" //"mt"
"fmt" //"fmt"
"jccommon" "jccommon"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -54,7 +54,8 @@ func Unlock721Nft(c *gin.Context, tokenType int32) {
Params: []string{}, Params: []string{},
} }
paramsStr := q5.EncodeJson(reqJson) paramsStr := q5.EncodeJson(reqJson)
url := fmt.Sprintf("%s/webapp/index.php", mt.Table.Web3SignCluster.RandElement().GetUrl()) //url := fmt.Sprintf("%s/webapp/index.php", mt.Table.Web3SignCluster.RandElement().GetUrl())
url := ""
f5.GetHttpCliMgr().SendGoStyleJsonRspPost( f5.GetHttpCliMgr().SendGoStyleJsonRspPost(
url, url,
params, params,