26 lines
491 B
Go
26 lines
491 B
Go
|
|
package open
|
||
|
|
|
||
|
|
import (
|
||
|
|
"cs-agent/internal/pkg/dto/response"
|
||
|
|
"cs-agent/internal/pkg/irisx"
|
||
|
|
|
||
|
|
"github.com/kataras/iris/v12"
|
||
|
|
"github.com/mlogclub/simple/web"
|
||
|
|
)
|
||
|
|
|
||
|
|
type ImWidgetController struct {
|
||
|
|
Ctx iris.Context
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *ImWidgetController) AnyConfig() *web.JsonResult {
|
||
|
|
channel := irisx.GetChannel(c.Ctx)
|
||
|
|
if channel == nil {
|
||
|
|
return web.JsonErrorMsg("接入渠道未初始化")
|
||
|
|
}
|
||
|
|
|
||
|
|
ret := response.WidgetConfigResponse{
|
||
|
|
ChannelID: channel.ChannelID,
|
||
|
|
}
|
||
|
|
return web.JsonData(ret)
|
||
|
|
}
|