- 达达与美团配送的接口修改为较正式参数
This commit is contained in:
@@ -13,9 +13,9 @@ type CallbackResponse struct {
|
||||
}
|
||||
|
||||
type CallbackCommonMsg struct {
|
||||
AppKey string
|
||||
Timestamp int64
|
||||
Sign string
|
||||
AppKey string `json:"appkey"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Sign string `json:"sign"`
|
||||
}
|
||||
|
||||
type CallbackOrderMsg struct {
|
||||
@@ -35,6 +35,17 @@ type CallbackOrderExceptionMsg struct {
|
||||
ExceptionTime int64
|
||||
}
|
||||
|
||||
type CallbackShopStatusMsg struct {
|
||||
ShopName string `json:"shop_name"`
|
||||
ShopID string `json:"shop_id"`
|
||||
Status int `json:"status"`
|
||||
RejectMessage string `json:"reject_message"`
|
||||
|
||||
AppKey string `json:"appkey"`
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
Sign string `json:"sign"`
|
||||
}
|
||||
|
||||
var (
|
||||
SuccessResponse = &CallbackResponse{Code: 0}
|
||||
SignatureIsNotOk = &CallbackResponse{Code: -1}
|
||||
@@ -117,6 +128,16 @@ func (a *API) GetOrderExceptionCallbackMsg(request *http.Request) (orderMsg *Cal
|
||||
ExceptionDescr: request.FormValue("exception_descr"),
|
||||
ExceptionTime: utils.Str2Int64(request.FormValue("exception_time")),
|
||||
}
|
||||
|
||||
return orderMsg, nil
|
||||
}
|
||||
|
||||
func (a *API) GetShopStatusCallbackMsg(request *http.Request) (shopStatusMsg *CallbackShopStatusMsg, callbackResponse *CallbackResponse) {
|
||||
if callbackResponse = a.CheckCallbackValidation(request); callbackResponse != nil {
|
||||
return nil, callbackResponse
|
||||
}
|
||||
err := utils.Map2StructByJson(utils.URLValues2Map(request.PostForm), &shopStatusMsg, false)
|
||||
if err != nil {
|
||||
callbackResponse = Err2CallbackResponse(err, "")
|
||||
}
|
||||
return shopStatusMsg, callbackResponse
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user