msgtype
This commit is contained in:
@@ -30,18 +30,18 @@ const (
|
|||||||
TopicOrderFinish = "open_message_order_order_finish" //订单完成
|
TopicOrderFinish = "open_message_order_order_finish" //订单完成
|
||||||
TopicOrderCancel = "open_message_order_order_cancel" //订单取消
|
TopicOrderCancel = "open_message_order_order_cancel" //订单取消
|
||||||
|
|
||||||
Size = 1 //默认一次取10条
|
Size = 10 //默认一次取10条
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
TopicList = []string{
|
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_out", //POP订单出库
|
||||||
"open_message_pop_order_create", //POP订单创建
|
// "open_message_pop_order_create", //POP订单创建
|
||||||
// "open_message_pop_order_change", //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_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,
|
"topic": topic,
|
||||||
"consumerGroupId": consumerGroupId,
|
"consumerGroupId": consumerGroupId,
|
||||||
"size": size,
|
"size": size,
|
||||||
|
"ack": "true", //默认消费之后就确认
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
utils.Map2StructByJson(result["result"].(map[string]interface{})["messages"], &consumeInfoResult, false)
|
utils.Map2StructByJson(result["result"].(map[string]interface{})["messages"], &consumeInfoResult, false)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ type CallBackResult struct {
|
|||||||
OrderID string `json:"orderId"`
|
OrderID string `json:"orderId"`
|
||||||
OrderSource string `json:"orderSource"`
|
OrderSource string `json:"orderSource"`
|
||||||
FreightPrice string `json:"freightPrice"`
|
FreightPrice string `json:"freightPrice"`
|
||||||
|
MsgType string `json:"msgType"`
|
||||||
ConsigneeInfo *CallBackConsigneeInfo `json:"consigneeInfo"`
|
ConsigneeInfo *CallBackConsigneeInfo `json:"consigneeInfo"`
|
||||||
ItemInfoList []*CallBackItemInfoList `json:"itemInfoList"`
|
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 {
|
if err = json.Unmarshal([]byte(mapData["orderInfo"].(string)), &call); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
call.MsgType = mapData["msgType"].(string)
|
||||||
return call, err
|
return call, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user