Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -53,40 +53,42 @@ type GetPoiIMStatusReq struct {
|
||||
}
|
||||
|
||||
type GetPoiIMStatusResp struct {
|
||||
VendorID int `json:"vendorID"`
|
||||
ImStatus int `json:"imStatus"`
|
||||
VendorID int `json:"vendorID"`
|
||||
ImStatus int `json:"imStatus"`
|
||||
ErrMsg string `json:"errMsg"`
|
||||
}
|
||||
|
||||
// GetPoiIMStatus 查询门店IM单聊开关状态
|
||||
func GetPoiIMStatus(param []GetPoiIMStatusReq) (retVal []*GetPoiIMStatusResp, err error) {
|
||||
func GetPoiIMStatus(param []GetPoiIMStatusReq) (retVal []*GetPoiIMStatusResp) {
|
||||
var (
|
||||
ans1 = &GetPoiIMStatusResp{}
|
||||
ans2 = &GetPoiIMStatusResp{}
|
||||
)
|
||||
if len(param) == 0 {
|
||||
return nil, nil
|
||||
return nil
|
||||
}
|
||||
for _, v := range param {
|
||||
switch v.VendorID {
|
||||
case model.VendorIDMTWM:
|
||||
temp, err := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, v.VendorOrgCode).(*mtwmapi.API).GetPoiIMStatus(v.VendorStoreID)
|
||||
if err != nil {
|
||||
ans1.ErrMsg = fmt.Sprintf("1:%v", err)
|
||||
continue
|
||||
}
|
||||
retVal = append(retVal, &GetPoiIMStatusResp{
|
||||
VendorID: model.VendorIDMTWM,
|
||||
ImStatus: temp.ImStatus,
|
||||
})
|
||||
ans1.VendorID = model.VendorIDMTWM
|
||||
ans1.ImStatus = temp.ImStatus
|
||||
case model.VendorIDEBAI:
|
||||
//status, err := api.EbaiAPI.GetStoreIMStatus(v.VendorStoreID)
|
||||
status, err := partner.CurAPIManager.GetAPI(model.VendorIDEBAI, v.VendorOrgCode).(*ebaiapi.API).GetStoreIMStatus(v.VendorStoreID)
|
||||
if err != nil {
|
||||
ans1.ErrMsg = fmt.Sprintf("3:%v", err)
|
||||
continue
|
||||
}
|
||||
retVal = append(retVal, &GetPoiIMStatusResp{
|
||||
VendorID: model.VendorIDMTWM,
|
||||
ImStatus: utils.Str2Int(status),
|
||||
})
|
||||
ans2.VendorID = model.VendorIDEBAI
|
||||
ans2.ImStatus = utils.Str2Int(status)
|
||||
}
|
||||
}
|
||||
|
||||
return retVal, nil
|
||||
retVal = append(retVal, ans1, ans2)
|
||||
return retVal
|
||||
}
|
||||
|
||||
type SetPoiIMStatusReq struct {
|
||||
|
||||
Reference in New Issue
Block a user