1
This commit is contained in:
@@ -116,18 +116,23 @@ type AbnormalReportNotify struct {
|
|||||||
|
|
||||||
// 获取门店状态回调消息
|
// 获取门店状态回调消息
|
||||||
func (a *API) GetChainstoreStatusNotify(request *http.Request) (shopStatusMsg *ChainstoreStatusNotify, callbackResponse *CallbackResponse) {
|
func (a *API) GetChainstoreStatusNotify(request *http.Request) (shopStatusMsg *ChainstoreStatusNotify, callbackResponse *CallbackResponse) {
|
||||||
storeNotify := ShortStatus{}
|
data, err := ioutil.ReadAll(request.Body)
|
||||||
err := utils.Map2StructByJson(utils.URLValues2Map(request.PostForm), &storeNotify, true)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
callbackResponse = &CallbackResponse{Code: -1}
|
||||||
|
return nil, callbackResponse
|
||||||
|
}
|
||||||
|
|
||||||
|
storeNotify := make(map[string]interface{}, 4)
|
||||||
|
if err := utils.Map2StructByJson(data, storeNotify, true); err != nil {
|
||||||
baseapi.SugarLogger.Debugf("FN GetShopStatusCallbackMsg failed with err:%v", err)
|
baseapi.SugarLogger.Debugf("FN GetShopStatusCallbackMsg failed with err:%v", err)
|
||||||
callbackResponse = &CallbackResponse{Code: -1}
|
callbackResponse = &CallbackResponse{Code: -1}
|
||||||
return nil, callbackResponse
|
return nil, callbackResponse
|
||||||
}
|
}
|
||||||
fmt.Println("回调数据=============================", storeNotify.BusinessData)
|
fmt.Println("回调数据=============================", storeNotify["business_data"])
|
||||||
|
|
||||||
fnNotify := &ChainstoreStatusNotify{}
|
fnNotify := &ChainstoreStatusNotify{}
|
||||||
if err := json.Unmarshal([]byte(utils.Interface2String(storeNotify.BusinessData)), fnNotify); err != nil {
|
if err := json.Unmarshal([]byte(utils.Interface2String(storeNotify["business_data"])), fnNotify); err != nil {
|
||||||
baseapi.SugarLogger.Debugf("FN callback string to ChainstoreStatusNotify failed with err:%v", err)
|
baseapi.SugarLogger.Debugf("FN callback string to GetChainstoreStatusNotify failed with err:%v", err)
|
||||||
callbackResponse = &CallbackResponse{Code: -1}
|
callbackResponse = &CallbackResponse{Code: -1}
|
||||||
return nil, callbackResponse
|
return nil, callbackResponse
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user