- 将美团配送门店相关的API单独拆分出来

- 去掉美团配送CheckCallbackValidation中的强制参数检查
This commit is contained in:
gazebo
2019-07-23 14:53:09 +08:00
parent fd83745144
commit 1fbb2eac0f
4 changed files with 104 additions and 82 deletions

View File

@@ -68,16 +68,14 @@ func (a *API) CheckCallbackValidation(request *http.Request) (callbackResponse *
baseapi.SugarLogger.Infof("Signature is not ok, mine:%v, get:%v", sign, request.FormValue(signKey))
return SignatureIsNotOk
}
for _, valueKey := range []string{"delivery_id", "mt_peisong_id", "order_id"} {
if request.FormValue(valueKey) == "" {
baseapi.SugarLogger.Errorf("Missing mandatory param PostForm:%v, valueKey:%v", request.PostForm, valueKey)
return &CallbackResponse{
Code: -1,
}
}
}
return nil
// for _, valueKey := range []string{"delivery_id", "mt_peisong_id", "order_id"} {
// if request.FormValue(valueKey) == "" {
// baseapi.SugarLogger.Errorf("Missing mandatory param PostForm:%v, valueKey:%v", request.PostForm, valueKey)
// return &CallbackResponse{
// Code: -1,
// }
// }
// }
}
return Err2CallbackResponse(err, "")
}