This commit is contained in:
苏尹岚
2020-07-29 16:27:33 +08:00
parent 06e2a75f8c
commit a738dc4359
2 changed files with 8 additions and 5 deletions

View File

@@ -30,18 +30,18 @@ const (
TopicOrderFinish = "open_message_order_order_finish" //订单完成
TopicOrderCancel = "open_message_order_order_cancel" //订单取消
Size = 1 //默认一次取10条
Size = 10 //默认一次取10条
)
var (
TopicList = []string{
// "open_message_pop_order_remk_chg", //POP订单备注变更
"open_message_pop_order_remk_chg", //POP订单备注变更
// "open_message_pop_order_out", //POP订单出库
"open_message_pop_order_create", //POP订单创建
// "open_message_pop_order_create", //POP订单创建
// "open_message_pop_order_change", //POP订单变更消息
// "open_message_order_order_pay", //订单付款
"open_message_order_order_pay", //订单付款
// "open_message_order_order_finish", //订单完成
// "open_message_order_order_cancel", //订单取消
"open_message_order_order_cancel", //订单取消
}
)
@@ -137,6 +137,7 @@ func (a *API) ConsumeInfo(topic, consumerGroupId string, size int) (consumeInfoR
"topic": topic,
"consumerGroupId": consumerGroupId,
"size": size,
"ack": "true", //默认消费之后就确认
})
if err == nil {
utils.Map2StructByJson(result["result"].(map[string]interface{})["messages"], &consumeInfoResult, false)

View File

@@ -24,6 +24,7 @@ type CallBackResult struct {
OrderID string `json:"orderId"`
OrderSource string `json:"orderSource"`
FreightPrice string `json:"freightPrice"`
MsgType string `json:"msgType"`
ConsigneeInfo *CallBackConsigneeInfo `json:"consigneeInfo"`
ItemInfoList []*CallBackItemInfoList `json:"itemInfoList"`
}
@@ -70,5 +71,6 @@ func (a *API) GetCallbackMsg(request *http.Request) (call *CallBackResult, err e
if err = json.Unmarshal([]byte(mapData["orderInfo"].(string)), &call); err != nil {
return nil, err
}
call.MsgType = mapData["msgType"].(string)
return call, err
}