@@ -82,6 +82,7 @@ type configUIScheduledTask struct {
8282 Product string `json:"product"`
8383 Project string `json:"project"`
8484 Workspace string `json:"workspace"`
85+ Region string `json:"region"`
8586 Webhook configUIWebhook `json:"webhook"`
8687}
8788
@@ -104,6 +105,7 @@ type configUIGlobal struct {
104105 Product string `json:"product"`
105106 Project string `json:"project"`
106107 Workspace string `json:"workspace"`
108+ Region string `json:"region"`
107109}
108110
109111type configUIAuth struct {
@@ -135,6 +137,7 @@ type configUIConversationRoute struct {
135137 Product string `json:"product"`
136138 Project string `json:"project"`
137139 Workspace string `json:"workspace"`
140+ Region string `json:"region"`
138141}
139142
140143type configUIDingTalk struct {
@@ -147,6 +150,7 @@ type configUIDingTalk struct {
147150 Product string `json:"product"`
148151 Project string `json:"project"`
149152 Workspace string `json:"workspace"`
153+ Region string `json:"region"`
150154 AllowedGroupUsers []string `json:"allowedGroupUsers"`
151155 AllowedDirectUsers []string `json:"allowedDirectUsers"`
152156 AllowedConversations []string `json:"allowedConversations"`
@@ -165,6 +169,7 @@ type configUIFeishu struct {
165169 Product string `json:"product"`
166170 Project string `json:"project"`
167171 Workspace string `json:"workspace"`
172+ Region string `json:"region"`
168173 AllowedUsers []string `json:"allowedUsers"`
169174 AllowedChats []string `json:"allowedChats"`
170175}
@@ -184,18 +189,31 @@ type configUIWeCom struct {
184189 Product string `json:"product"`
185190 Project string `json:"project"`
186191 Workspace string `json:"workspace"`
192+ Region string `json:"region"`
187193 AllowedUsers []string `json:"allowedUsers"`
194+ WebhookURL string `json:"webhookUrl"`
195+ BotLongConn struct {
196+ Enabled bool `json:"enabled"`
197+ BotID string `json:"botId"`
198+ BotSecret string `json:"botSecret"`
199+ URL string `json:"url"`
200+ PingIntervalSec int `json:"pingIntervalSec"`
201+ ReconnectDelaySec int `json:"reconnectDelaySec"`
202+ MaxReconnectDelaySec int `json:"maxReconnectDelaySec"`
203+ } `json:"botLongConn"`
188204}
189205
190206type configUIWeComBot struct {
191207 Enabled bool `json:"enabled"`
208+ Name string `json:"name"`
192209 BotID string `json:"botId"`
193210 BotSecret string `json:"botSecret"`
194211 EmployeeName string `json:"employeeName"`
195212 ConciseReply bool `json:"conciseReply"`
196213 Product string `json:"product"`
197214 Project string `json:"project"`
198215 Workspace string `json:"workspace"`
216+ Region string `json:"region"`
199217}
200218
201219type configUIOpenAI struct {
@@ -233,6 +251,7 @@ func (s *Server) handleGetConfig(c *gin.Context) {
233251 Product : cfg .Global .Product ,
234252 Project : cfg .Global .Project ,
235253 Workspace : cfg .Global .Workspace ,
254+ Region : cfg .Global .Region ,
236255 },
237256 Auth : configUIAuth {
238257 Methods : cfg .Auth .Methods ,
@@ -273,6 +292,7 @@ func (s *Server) handleGetConfig(c *gin.Context) {
273292 Product : r .Product ,
274293 Project : r .Project ,
275294 Workspace : r .Workspace ,
295+ Region : r .Region ,
276296 }
277297 }
278298 resp .DingTalk [i ] = configUIDingTalk {
@@ -285,6 +305,7 @@ func (s *Server) handleGetConfig(c *gin.Context) {
285305 Product : dt .Product ,
286306 Project : dt .Project ,
287307 Workspace : dt .Workspace ,
308+ Region : dt .Region ,
288309 AllowedGroupUsers : dt .AllowedGroupUsers ,
289310 AllowedDirectUsers : dt .AllowedDirectUsers ,
290311 AllowedConversations : dt .AllowedConversations ,
@@ -311,6 +332,7 @@ func (s *Server) handleGetConfig(c *gin.Context) {
311332 Product : ft .Product ,
312333 Project : ft .Project ,
313334 Workspace : ft .Workspace ,
335+ Region : ft .Region ,
314336 AllowedUsers : ft .AllowedUsers ,
315337 AllowedChats : ft .AllowedChats ,
316338 }
@@ -338,6 +360,7 @@ func (s *Server) handleGetConfig(c *gin.Context) {
338360 Product : wc .Product ,
339361 Project : wc .Project ,
340362 Workspace : wc .Workspace ,
363+ Region : wc .Region ,
341364 AllowedUsers : wc .AllowedUsers ,
342365 }
343366 }
@@ -351,13 +374,15 @@ func (s *Server) handleGetConfig(c *gin.Context) {
351374 for i , wb := range cfg .Channels .WeComBot {
352375 resp .WeComBot [i ] = configUIWeComBot {
353376 Enabled : wb .Enabled ,
377+ Name : wb .Name ,
354378 BotID : wb .BotID ,
355379 BotSecret : wb .BotSecret ,
356380 EmployeeName : wb .EmployeeName ,
357381 ConciseReply : wb .ConciseReply ,
358382 Product : wb .Product ,
359383 Project : wb .Project ,
360384 Workspace : wb .Workspace ,
385+ Region : wb .Region ,
361386 }
362387 }
363388 } else {
@@ -389,6 +414,7 @@ func (s *Server) handleGetConfig(c *gin.Context) {
389414 Product : t .Product ,
390415 Project : t .Project ,
391416 Workspace : t .Workspace ,
417+ Region : t .Region ,
392418 Webhook : configUIWebhook {
393419 Type : t .Webhook .Type ,
394420 URL : t .Webhook .URL ,
@@ -431,6 +457,7 @@ func (s *Server) handleSaveConfig(c *gin.Context) {
431457 Product : req .Global .Product ,
432458 Project : req .Global .Project ,
433459 Workspace : req .Global .Workspace ,
460+ Region : req .Global .Region ,
434461 },
435462 Auth : config.AuthConfig {
436463 Methods : req .Auth .Methods ,
@@ -471,6 +498,7 @@ func (s *Server) handleSaveConfig(c *gin.Context) {
471498 Product : r .Product ,
472499 Project : r .Project ,
473500 Workspace : r .Workspace ,
501+ Region : r .Region ,
474502 })
475503 }
476504 }
@@ -484,6 +512,7 @@ func (s *Server) handleSaveConfig(c *gin.Context) {
484512 Product : dt .Product ,
485513 Project : dt .Project ,
486514 Workspace : dt .Workspace ,
515+ Region : dt .Region ,
487516 AllowedGroupUsers : dt .AllowedGroupUsers ,
488517 AllowedDirectUsers : dt .AllowedDirectUsers ,
489518 AllowedConversations : dt .AllowedConversations ,
@@ -521,6 +550,7 @@ func (s *Server) handleSaveConfig(c *gin.Context) {
521550 Product : ft .Product ,
522551 Project : ft .Project ,
523552 Workspace : ft .Workspace ,
553+ Region : ft .Region ,
524554 AllowedUsers : allowedUsers ,
525555 AllowedChats : allowedChats ,
526556 })
@@ -555,6 +585,7 @@ func (s *Server) handleSaveConfig(c *gin.Context) {
555585 Product : wc .Product ,
556586 Project : wc .Project ,
557587 Workspace : wc .Workspace ,
588+ Region : wc .Region ,
558589 AllowedUsers : allowedUsers ,
559590 })
560591 }
@@ -571,13 +602,15 @@ func (s *Server) handleSaveConfig(c *gin.Context) {
571602 if wb .BotID != "" || wb .BotSecret != "" || wb .EmployeeName != "" {
572603 cfg .Channels .WeComBot = append (cfg .Channels .WeComBot , config.WeComBotConfig {
573604 Enabled : wb .Enabled ,
605+ Name : wb .Name ,
574606 BotID : wb .BotID ,
575607 BotSecret : wb .BotSecret ,
576608 EmployeeName : wb .EmployeeName ,
577609 ConciseReply : wb .ConciseReply ,
578610 Product : wb .Product ,
579611 Project : wb .Project ,
580612 Workspace : wb .Workspace ,
613+ Region : wb .Region ,
581614 })
582615 }
583616 }
@@ -607,6 +640,7 @@ func (s *Server) handleSaveConfig(c *gin.Context) {
607640 Product : t .Product ,
608641 Project : t .Project ,
609642 Workspace : t .Workspace ,
643+ Region : t .Region ,
610644 Webhook : config.WebhookConfig {
611645 Type : t .Webhook .Type ,
612646 URL : t .Webhook .URL ,
@@ -673,13 +707,14 @@ func (s *Server) handleTriggerTask(c *gin.Context) {
673707 clientCfg .Product = globalCfg .Global .Product
674708 }
675709
676- // 确定任务使用的 product/project/workspace
710+ // 确定任务使用的 product/project/workspace/region
677711 taskProduct := req .Product
678712 if taskProduct == "" {
679713 taskProduct = clientCfg .Product // 使用全局配置
680714 }
681715 taskProject := req .Project
682716 taskWorkspace := req .Workspace
717+ taskRegion := req .Region
683718
684719 type triggerResult struct {
685720 reply string
@@ -692,7 +727,7 @@ func (s *Server) handleTriggerTask(c *gin.Context) {
692727 if req .ConciseReply {
693728 prompt += "\n \n 简化最终输出 适合聊天工具上阅读"
694729 }
695- reply , err := scheduler .QueryEmployeeWithVariables (clientCfg , req .EmployeeName , prompt , taskProduct , taskProject , taskWorkspace )
730+ reply , err := scheduler .QueryEmployeeWithVariables (clientCfg , req .EmployeeName , prompt , taskProduct , taskProject , taskWorkspace , taskRegion )
696731 done <- triggerResult {reply : reply , err : err }
697732 }()
698733
0 commit comments