This commit is contained in:
邹宗楠
2024-01-19 15:36:12 +08:00
parent c6cb53c7a3
commit 8d19256710
4 changed files with 49 additions and 33 deletions

View File

@@ -115,26 +115,26 @@ type AbnormalReportNotify struct {
}
// 获取门店状态回调消息
func (a *API) GetChainstoreStatusNotify(request *http.Request) (shopStatusMsg *ChainstoreStatusNotify, callbackResponse *CallbackResponse) {
func (a *API) GetChainstoreStatusNotify(request *http.Request) (shopStatusMsg *ChainstoreStatusNotify, storeNotify *ShortStatus, callbackResponse *CallbackResponse) {
data, err := ioutil.ReadAll(request.Body)
if err != nil {
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
return nil, nil, callbackResponse
}
storeNotify := &ShortStatus{}
storeNotify = &ShortStatus{}
if err := json.Unmarshal(data, &storeNotify); err != nil {
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
return nil, nil, callbackResponse
}
fnNotify := &ChainstoreStatusNotify{}
if err := json.Unmarshal([]byte(storeNotify.BusinessData), fnNotify); err != nil {
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
return nil, nil, callbackResponse
}
return fnNotify, SuccessResponse
return fnNotify, storeNotify, SuccessResponse
}
// 获取订单状态回调消息
@@ -159,26 +159,26 @@ func (a *API) GetChainOrderStatusNotify(request *http.Request) (shopStatusMsg *O
}
// 异常配送
func (a *API) GetChainAbnormaltatusNotify(request *http.Request) (shopStatusMsg *AbnormalStatusNotify, callbackResponse *CallbackResponse) {
func (a *API) GetChainAbnormaltatusNotify(request *http.Request) (shopStatusMsg *AbnormalStatusNotify, storeNotify *ShortStatus, callbackResponse *CallbackResponse) {
data, err := ioutil.ReadAll(request.Body)
if err != nil {
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
return nil, nil, callbackResponse
}
storeNotify := &ShortStatus{}
storeNotify = &ShortStatus{}
if err := json.Unmarshal(data, &storeNotify); err != nil {
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
return nil, nil, callbackResponse
}
fnNotify := &AbnormalStatusNotify{}
if err := json.Unmarshal([]byte(storeNotify.BusinessData), fnNotify); err != nil {
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
return nil, nil, callbackResponse
}
return fnNotify, SuccessResponse
return fnNotify, storeNotify, SuccessResponse
}
func (a *API) CheckCallbackValidation(request *http.Request) (callbackResponse *CallbackResponse) {