Commit e0b5084c by imwangxiaozhou Committed by 胡悦

feat(wecom-customer-group): 新增配置项与建群限流,重构客户扫描逻辑

新增企微同步配置项customer_contact_type和max_group_creates_per_bot_per_job,并同步到Pydantic设置模型
重构新客户扫描逻辑,新增全量对比与预览模式,废弃旧的增量扫描与checkpoint逻辑
为建群请求添加单机器人每任务建群数量限制,基于配置项控制
将硬编码的客户联系类型改为从配置读取,新增deleted群组状态到无效状态集合
支持自动清理远端已不存在的本地客户数据
调整list_new_customers接口默认开启dry_run模式,避免意外写入数据
1 parent baaf449e
......@@ -96,7 +96,7 @@ def run_wecom_job(req: WeComJobRunRequest, services=Depends(get_services)):
def list_new_customers(req: WeComNewCustomersRequest, services=Depends(get_services)):
_, orchestration_service = services
try:
items = orchestration_service.scan_new_customers(bot_ids=req.bot_ids)
items = orchestration_service.scan_new_customers(bot_ids=req.bot_ids, dry_run=True)
payload = WeComNewCustomerListResponse(
total=len(items),
list=items,
......
......@@ -33,6 +33,8 @@ class IMSettings(BaseModel):
class WeComSyncSettings(BaseModel):
base_url: str = "http://192.168.3.84:8600/webim"
api_key: str = ""
customer_contact_type: str = "ww_customer"
max_group_creates_per_bot_per_job: int = 2
class DownstreamChatSettings(BaseModel):
......
......@@ -14,7 +14,9 @@
},
"wecom_sync": {
"base_url": "http://192.168.3.84:8600/webim",
"api_key": ""
"api_key": "",
"customer_contact_type": "ww_customer",
"max_group_creates_per_bot_per_job": 2
},
"downstream_chat": {
"host": "192.168.1.191",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!