cms/wwwroot/api/cms_leads_create.dspy
yumoqing 208625415a refactor: 统一wwwroot目录结构
- 将 entcms/wwwroot/* 移到 wwwroot/
- 将 dingdingflow/wwwroot/* 移到 wwwroot/dingdingflow/
- 更新 config.json 使用单一 wwwroot 映射
- 更新 init_any_permissions.py 扫描新路径
- 更新 init_superuser_permissions.py 用法说明
- 废弃 entcms/scripts/load_path.py 和 dingdingflow/scripts/load_path.py
- 更新 build.sh 构建步骤
- 更新 README.md 和 docs/architecture.md 目录说明
2026-06-03 16:34:00 +08:00

69 lines
1.4 KiB
Plaintext

import json
from appPublic.uniqueID import getID
config = getConfig('.')
DBPools(config.databases)
dbname = get_module_dbname('entcms')
sor = DBPools().sqlorContext(dbname)
data = {'id': getID()}
v = params_kw.get('org_id', None)
if v is not None:
data['org_id'] = v
v = params_kw.get('source', None)
if v is not None:
data['source'] = v
v = params_kw.get('name', None)
if v is not None:
data['name'] = v
v = params_kw.get('company', None)
if v is not None:
data['company'] = v
v = params_kw.get('phone', None)
if v is not None:
data['phone'] = v
v = params_kw.get('email', None)
if v is not None:
data['email'] = v
v = params_kw.get('industry', None)
if v is not None:
data['industry'] = v
v = params_kw.get('region', None)
if v is not None:
data['region'] = v
v = params_kw.get('interest_products', None)
if v is not None:
data['interest_products'] = v
v = params_kw.get('message', None)
if v is not None:
data['message'] = v
v = params_kw.get('raw_text', None)
if v is not None:
data['raw_text'] = v
v = params_kw.get('status', None)
if v is not None:
data['status'] = v
v = params_kw.get('assigned_to', None)
if v is not None:
data['assigned_to'] = v
v = params_kw.get('notes', None)
if v is not None:
data['notes'] = v
await sor.C('cms_leads', data)
print(json.dumps({'widgettype': 'Message', 'options': {'text': '创建成功', 'messagetype': 'success'}}, ensure_ascii=False))