1
This commit is contained in:
@@ -70,15 +70,15 @@ func OnImMsg(msg *mtwmapi.ImCallbackMsg) (response *mtwmapi.CallbackResponse) {
|
|||||||
if err = json.Unmarshal(str, &PushContentReq); err != nil {
|
if err = json.Unmarshal(str, &PushContentReq); err != nil {
|
||||||
return mtwmapi.SignatureIsNotOk
|
return mtwmapi.SignatureIsNotOk
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("----------msg := %s", utils.Format4Output(msg, false))
|
|
||||||
globals.SugarLogger.Debugf("----------PushContentReq := %s", utils.Format4Output(PushContentReq, false))
|
|
||||||
storeDetail, err2 := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), PushContentReq.AppPoiCode, model.VendorIDMTWM, utils.Int2Str(PushContentReq.AppID))
|
storeDetail, err2 := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), PushContentReq.AppPoiCode, model.VendorIDMTWM, utils.Int2Str(PushContentReq.AppID))
|
||||||
if err2 == nil || storeDetail == nil {
|
if err2 == nil || storeDetail == nil {
|
||||||
switch beego.BConfig.RunMode {
|
switch beego.BConfig.RunMode {
|
||||||
case model.ServerTypeFruits:
|
case model.ServerTypeFruits:
|
||||||
|
globals.SugarLogger.Debugf("----------msg pet := %s", utils.Format4Output(msg, false))
|
||||||
pushIMToGyOrPet(msg, model.ServerTypePet)
|
pushIMToGyOrPet(msg, model.ServerTypePet)
|
||||||
return mtwmapi.SuccessResponse
|
return mtwmapi.SuccessResponse
|
||||||
case model.ServerTypeVegetable:
|
case model.ServerTypeVegetable:
|
||||||
|
globals.SugarLogger.Debugf("----------msg jxgy:= %s", utils.Format4Output(msg, false))
|
||||||
pushIMToGyOrPet(msg, model.ServerTypeFruits)
|
pushIMToGyOrPet(msg, model.ServerTypeFruits)
|
||||||
return mtwmapi.SuccessResponse
|
return mtwmapi.SuccessResponse
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ func pushIMToGyOrPet(msg *mtwmapi.ImCallbackMsg, serverType string) {
|
|||||||
)
|
)
|
||||||
params := make(map[string]interface{})
|
params := make(map[string]interface{})
|
||||||
params["timestamp"] = msg.Timestamp
|
params["timestamp"] = msg.Timestamp
|
||||||
params["sign"] = msg.Sig
|
params["sig"] = msg.Sig
|
||||||
params["app_id"] = msg.AppID
|
params["app_id"] = msg.AppID
|
||||||
params["biz_type"] = msg.BizType
|
params["biz_type"] = msg.BizType
|
||||||
params["push_content"] = msg.PushContent
|
params["push_content"] = msg.PushContent
|
||||||
|
|||||||
Reference in New Issue
Block a user