1
This commit is contained in:
parent
ea6f71ba8e
commit
35b782733d
@ -1,5 +1,5 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"url": "http://127.0.0.1:7672/"
|
"url": "http://127.0.0.1:7672"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
6
server/jccommon/constant.go
Normal file
6
server/jccommon/constant.go
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
package jccommon
|
||||||
|
|
||||||
|
const (
|
||||||
|
NFT_TYPE_CFHERO = 1
|
||||||
|
NFT_TYPE_GOLD_BULLION = 11
|
||||||
|
)
|
1
server/jccommon/go.mod
Normal file
1
server/jccommon/go.mod
Normal file
@ -0,0 +1 @@
|
|||||||
|
module jccommon
|
@ -1,6 +1,11 @@
|
|||||||
package hero
|
package hero
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"q5"
|
||||||
|
"f5"
|
||||||
|
"mt"
|
||||||
|
"fmt"
|
||||||
|
"jccommon"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -9,4 +14,44 @@ type HeroApi struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *HeroApi) Use(c *gin.Context) {
|
func (this *HeroApi) Use(c *gin.Context) {
|
||||||
|
//openId := c.MustGet("open_id").(string)
|
||||||
|
|
||||||
|
rspObj := &struct {
|
||||||
|
ErrCode int32 `json:"errcode"`
|
||||||
|
ErrMsg string `json:"errmsg"`
|
||||||
|
}{}
|
||||||
|
|
||||||
|
reqJson := &struct {
|
||||||
|
NetId interface{} `json:"net_id"`
|
||||||
|
AccountAddress string `json:"account_address"`
|
||||||
|
Tokens interface{} `json:"tokens"`
|
||||||
|
}{}
|
||||||
|
if err := c.ShouldBindJSON(&reqJson); err != nil {
|
||||||
|
rspObj.ErrCode = 1
|
||||||
|
rspObj.ErrMsg = "json parse error"
|
||||||
|
c.JSON(200, rspObj)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
params := map[string]string{
|
||||||
|
"c": "BcService",
|
||||||
|
"a": "unlock721Nft",
|
||||||
|
"token_type": q5.ToString(jccommon.NFT_TYPE_CFHERO),
|
||||||
|
}
|
||||||
|
jsonRspObj := &struct {
|
||||||
|
ErrCode interface{} `json:"errcode"`
|
||||||
|
ErrMsg string `json:"errmsg"`
|
||||||
|
TransId string `json:"trans_id"`
|
||||||
|
Params []string `json:"params"`
|
||||||
|
}{}
|
||||||
|
paramsStr := q5.EncodeJson(reqJson)
|
||||||
|
url := fmt.Sprintf("%s/webapp/index.php", mt.Table.Config.GetById(0).GetGameapiUrl())
|
||||||
|
f5.GetHttpCliMgr().SendGoStyleJsonRspPost(
|
||||||
|
url,
|
||||||
|
params,
|
||||||
|
jsonRspObj,
|
||||||
|
q5.HTTP_HEADER_JSON,
|
||||||
|
paramsStr,
|
||||||
|
func(rsp f5.HttpCliResponse) {
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user