...
|
...
|
@@ -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,
|
|
|
}
|
|
|
} |
...
|
...
|
|