(req dto.AgentQQBotConfigUpdateReq)
| 213 | } |
| 214 | |
| 215 | func (a AgentService) UpdateQQBotConfig(req dto.AgentQQBotConfigUpdateReq) error { |
| 216 | agent, install, err := a.loadAgentAndInstall(req.AgentID) |
| 217 | if err != nil { |
| 218 | return err |
| 219 | } |
| 220 | if agent.AgentType == constant.AppHermesAgent { |
| 221 | return updateHermesChannelConfig(agent, install, func(confDir string) error { |
| 222 | return writeHermesQQBotChannelConfig(confDir, dto.AgentQQBotConfig{ |
| 223 | Enabled: req.Enabled, |
| 224 | DmPolicy: req.DmPolicy, |
| 225 | AllowFrom: req.AllowFrom, |
| 226 | GroupPolicy: req.GroupPolicy, |
| 227 | GroupAllowFrom: req.GroupAllowFrom, |
| 228 | Bots: req.Bots, |
| 229 | }) |
| 230 | }) |
| 231 | } |
| 232 | return a.mutateAgentConfig(req.AgentID, func(_ *model.Agent, _ *model.AppInstall, conf map[string]interface{}) error { |
| 233 | setQQBotConfig(conf, dto.AgentQQBotConfig{ |
| 234 | Enabled: req.Enabled, |
| 235 | Bots: req.Bots, |
| 236 | }) |
| 237 | return nil |
| 238 | }) |
| 239 | } |
| 240 | |
| 241 | func (a AgentService) GetWecomConfig(req dto.AgentIDReq) (*dto.AgentWecomConfig, error) { |
| 242 | agent, install, err := a.loadAgentAndInstall(req.AgentID) |
nothing calls this directly
no test coverage detected