- 京西自营商城可以存订单了
This commit is contained in:
36
business/partner/purchase/jx/callback.go
Normal file
36
business/partner/purchase/jx/callback.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package jx
|
||||
|
||||
import "fmt"
|
||||
|
||||
const (
|
||||
appKey = "4A86853D-E4B6-454E-940A-B68ECDA2B73E"
|
||||
|
||||
MsgTypeOrder = "order"
|
||||
SubMsgTypeOrderNew = "newOrder"
|
||||
SubMsgTypeOrderAdjust = "adjustOrder"
|
||||
SubMsgTypeOrderApplyCancel = "applyCancel"
|
||||
// SubMsgTypeOrderApplayRefund = "applyRefund"
|
||||
)
|
||||
|
||||
type CallbackResponse struct {
|
||||
Code int `json:"code"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
type CallbackMsg struct {
|
||||
AppKey string `json:"appKey"`
|
||||
MsgType string `json:"msgType"`
|
||||
SubMsgType string `json:"subMsgType"`
|
||||
ThingID string `json:"thingID"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
func OnCallbackMsg(msg *CallbackMsg) (retVal, errCode string, err error) {
|
||||
if msg.AppKey != appKey {
|
||||
return retVal, errCode, fmt.Errorf("无效的AppKey:%s", msg.AppKey)
|
||||
}
|
||||
if msg.MsgType == MsgTypeOrder {
|
||||
retVal, errCode, err = CurPurchaseHandler.OnOrderMsg(msg)
|
||||
}
|
||||
return retVal, errCode, err
|
||||
}
|
||||
Reference in New Issue
Block a user