This commit is contained in:
richboo111
2023-09-01 16:08:25 +08:00
parent f6e71c3c36
commit 6ee80aa437
3 changed files with 54 additions and 8 deletions

View File

@@ -5,6 +5,8 @@ import (
"encoding/json"
"fmt"
"git.rosy.net.cn/jx-callback/globals/api"
"git.rosy.net.cn/jx-callback/business/partner/purchase/im"
"github.com/astaxie/beego/server/web"
)
@@ -85,3 +87,32 @@ func (c *IMController) SendToVendorV2() {
return nil, "", nil
})
}
// @Title 查询美团门店IM单聊开关状态
// @Description 查询美团门店IM单聊开关状态
// @Param token header string true "认证token"
// @Param appPoiCode query string true "美团门店id"
// @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)
return retVal, "", err
})
}
// @Title 设置美团门店IM线上状态
// @Description 设置美团门店IM线上状态
// @Param token header string true "认证token"
// @Param appPoiCode formData string true "美团门店id"
// @Param imStatus formData int true "状态 0-关闭 1-开启"
// @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)
return nil, "", err
})
}