- mtwm callback
This commit is contained in:
29
platformapi/mtwmapi/callback.go
Normal file
29
platformapi/mtwmapi/callback.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package mtwmapi
|
||||
|
||||
const (
|
||||
MsgTypeWaybillStatus = "waybillStatus"
|
||||
MsgTypeNewOrder = "newOrder"
|
||||
MsgTypeOrderAccepted = "orderAccepted"
|
||||
MsgTypeOrderFinished = "orderFinished"
|
||||
MsgTypeOrderFinancial = "orderFinancial"
|
||||
MsgTypeUserUrgeOrder = "userUrgeOrder"
|
||||
MsgTypePrivateNumberDowngrade = "numberDowngrade"
|
||||
MsgTypeOrderModified = "orderModified"
|
||||
)
|
||||
|
||||
type CallbackResponse struct {
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
var (
|
||||
SuccessResponse = &CallbackResponse{Data: "ok"}
|
||||
)
|
||||
|
||||
func Err2CallbackResponse(err error, data string) *CallbackResponse {
|
||||
if err == nil {
|
||||
return SuccessResponse
|
||||
}
|
||||
return &CallbackResponse{
|
||||
Data: data,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user