35 lines
948 B
Go
35 lines
948 B
Go
package ebai
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
|
|
"git.rosy.net.cn/jx-callback/business/partner/im"
|
|
"git.rosy.net.cn/jx-callback/globals/api"
|
|
)
|
|
|
|
const (
|
|
IMVendorIDELM = 3 //饿了么
|
|
)
|
|
|
|
// OnImMessage 用户/骑手 发送/已读消息 回调
|
|
func (p *PurchaseHandler) OnImMessage(msg *ebaiapi.CallbackMsg) (response *ebaiapi.CallbackResponse) {
|
|
str, err := json.Marshal(msg.Data)
|
|
|
|
im.ReadMsgFromVendor(IMVendorIDELM, msg.Source, str)
|
|
//return nil
|
|
return api.EbaiAPI.Err2CallbackResponse(msg.Cmd, err, nil)
|
|
}
|
|
|
|
// GetStoreIMStatus 查询门店IM开关状态
|
|
func GetStoreIMStatus(platformShopId string) (string, error) {
|
|
retVal, err := api.EbaiAPI.GetStoreIMStatus(platformShopId)
|
|
return retVal, err
|
|
}
|
|
|
|
// UpdateIMStatus 更新店铺IM开关状态 1-开启,-1-关闭
|
|
func UpdateIMStatus(platformShopId string, status int) error {
|
|
err := api.EbaiAPI.UpdateIMStatus(platformShopId, status)
|
|
return err
|
|
}
|