作者 yangfu

参数修改

... ... @@ -39,6 +39,8 @@ var SUPLUS_SALE_APP = "http://suplus-sale-app-gateway-test.fjmaimaimai.com"
// TODO:特殊短信验证码,不验证,正式环境注入空
var SMSCODE_ALL_POWER = "999512"
var EnableBlockChain = true
func init() {
if os.Getenv("LOG_LEVEL") != "" {
LOG_LEVEL = os.Getenv("LOG_LEVEL")
... ...
... ... @@ -4,6 +4,7 @@ import (
"fmt"
"github.com/linmadan/egglib-go/utils/json"
"github.com/tal-tech/go-queue/kq"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"strings"
)
... ... @@ -23,8 +24,9 @@ func RegisterDefaultPusherClient(host, topic string) {
// 异步推送到队列
func Push(topic string, o interface{}) error {
// TODO:功能未开启
return nil
if !constant.EnableBlockChain {
return nil
}
var pusher *kq.Pusher
var ok bool
if pusher, ok = defaultClientMap[topic]; !ok {
... ... @@ -35,10 +37,14 @@ func Push(topic string, o interface{}) error {
// 新建一个推送对象
func NewPushObject(source, primaryId, issueId string, obj interface{}) interface{} {
return map[string]interface{}{
data := map[string]interface{}{
"source": source,
"primaryId": primaryId,
"issueId": issueId,
"data": json.MarshalToString(obj),
}
return map[string]interface{}{
"topic": "up_block_chain",
"data": data,
}
}
... ...
... ... @@ -3,13 +3,15 @@ package allied_creation_user
import (
"encoding/json"
"fmt"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
func (gateway HttplibAlliedCreationUser) ListBlockChains(param ReqListBlockChain) (DataListBlockChain, error) {
// TODO:功能未开启
return []DataListBlockChainItem{}, nil
if !constant.EnableBlockChain {
return []DataListBlockChainItem{}, nil
}
url := gateway.baseUrL + "/block-chains/"
method := "post"
req := gateway.CreateRequest(url, method)
... ...