1
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils/errlist"
|
||||
@@ -18,15 +20,15 @@ import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
push "git.rosy.net.cn/jx-callback/business/jxutils/unipush"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
func SendVendorV2(data SendData) (err error) {
|
||||
func SendVendorV2(data SendData, vendorOrgCode string) (err error) {
|
||||
if data.VendorID == model.VendorIDMTWM {
|
||||
dataStr, _ := json.Marshal(data.Data)
|
||||
temp := string(dataStr)
|
||||
globals.SugarLogger.Debugf("SendVendorV2 temp=%s", temp)
|
||||
if _, err = api.MtwmAPI.MsgSend(string(dataStr)); err != nil {
|
||||
//if _, err = api.MtwmAPI.MsgSend(string(dataStr)); err != nil {
|
||||
if _, err = partner.CurAPIManager.GetAPI(model.VendorIDMTWM, vendorOrgCode).(*mtwmapi.API).MsgSend(string(dataStr)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/im"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
@@ -69,6 +71,7 @@ func (c *IMController) SetImMsgRead() {
|
||||
// @Title 向平台商发送信息(https方式)
|
||||
// @Description 向平台商发送信息(https方式)
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorOrgCode formData string true "美团appid"
|
||||
// @Param sendData formData string true "平台商消息结构体"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
@@ -80,7 +83,7 @@ func (c *IMController) SendToVendorV2() {
|
||||
decoder := json.NewDecoder(b)
|
||||
if err = decoder.Decode(&sendData); err == nil {
|
||||
fmt.Println(sendData)
|
||||
if err = im.SendVendorV2(sendData); err != nil {
|
||||
if err = im.SendVendorV2(sendData, params.VendorOrgCode); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
}
|
||||
@@ -92,12 +95,14 @@ func (c *IMController) SendToVendorV2() {
|
||||
// @Description 查询美团门店IM单聊开关状态
|
||||
// @Param token header string true "认证token"
|
||||
// @Param appPoiCode query string true "美团门店id"
|
||||
// @Param vendorOrgCode query string true "美团appid"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetPoiIMStatus [get]
|
||||
func (c *IMController) GetPoiIMStatus() {
|
||||
c.callGetPoiIMStatus(func(params *tImGetPoiIMStatusParams) (interface{}, string, error) {
|
||||
retVal, err := api.MtwmAPI.GetPoiIMStatus(params.AppPoiCode)
|
||||
//retVal, err := api.MtwmAPI.GetPoiIMStatus(params.AppPoiCode)
|
||||
retVal, err := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, params.VendorOrgCode).(*mtwmapi.API).GetPoiIMStatus(params.AppPoiCode)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
@@ -107,12 +112,14 @@ func (c *IMController) GetPoiIMStatus() {
|
||||
// @Param token header string true "认证token"
|
||||
// @Param appPoiCode formData string true "美团门店id"
|
||||
// @Param imStatus formData int true "状态 0-关闭 1-开启"
|
||||
// @Param vendorOrgCode formData string true "美团appid"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /SetPoiIMStatus [post]
|
||||
func (c *IMController) SetPoiIMStatus() {
|
||||
c.callSetPoiIMStatus(func(params *tImSetPoiIMStatusParams) (interface{}, string, error) {
|
||||
err := api.MtwmAPI.SetPoiIMStatus(params.AppPoiCode, params.ImStatus)
|
||||
//err := api.MtwmAPI.SetPoiIMStatus(params.AppPoiCode, params.ImStatus)
|
||||
err := partner.CurAPIManager.GetAPI(model.VendorIDMTWM, params.VendorOrgCode).(*mtwmapi.API).SetPoiIMStatus(params.AppPoiCode, params.ImStatus)
|
||||
return nil, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user