feat: 新增企业微信应用消息发送渠道
- 添加 WeChatCorpAccount 消息类型常量 - 新增企业微信应用配置结构体和渠道验证逻辑 - 实现企业微信应用消息发送服务,支持 text、markdown 和 textcard 格式 - 添加前端配置界面,支持动态接收者设置 - 集成代理支持(HTTP/HTTPS/SOCKS5)
This commit is contained in:
@@ -58,6 +58,24 @@ func (sw *SendTaskInsService) ValidateDiffIns(ins models.SendTasksIns) (string,
|
||||
var Config models.InsQyWeiXinConfig
|
||||
return "", Config
|
||||
}
|
||||
if ins.WayType == constant.MessageTypeWeChatCorpAccount {
|
||||
var Config models.InsWeChatCorpAccountConfig
|
||||
err := json.Unmarshal([]byte(ins.Config), &Config)
|
||||
if err != nil {
|
||||
return "企业微信应用发送配置反序列化失败!", empty
|
||||
}
|
||||
|
||||
var configMap map[string]interface{}
|
||||
json.Unmarshal([]byte(ins.Config), &configMap)
|
||||
allowMultiRecip, exists := configMap["allowMultiRecip"].(bool)
|
||||
|
||||
if exists && allowMultiRecip && Config.ToAccount == "" {
|
||||
return "", Config
|
||||
}
|
||||
|
||||
_, Msg := app.CommonPlaygroundValid(Config)
|
||||
return Msg, Config
|
||||
}
|
||||
if ins.WayType == constant.MessageTypeFeishu {
|
||||
var Config models.InsFeishuConfig
|
||||
return "", Config
|
||||
|
||||
Reference in New Issue
Block a user