entcms模块: - 4个数据表(cms_content/cms_categories/cms_leads/cms_site_config) - 22个.dspy API(含公开API和data_filter) - 4个公开页面(首页/新闻/案例)+管理后台 - 完整营销站点CSS/JS(暗色主题/渐变/动画/响应式) - 云宝SVG线稿占位符 - RBAC权限配置 dingdingflow模块: - 2个数据表(dd_approvals/dd_approval_configs) - 10个.dspy API(含钉钉回调endpoint) - 钉钉API客户端(环境变量配置,开发模式mock) - 管理UI 文档: 架构设计/53条测试用例/开发日志
37 lines
922 B
Plaintext
37 lines
922 B
Plaintext
import json
|
|
from appPublic.uniqueID import getID
|
|
|
|
config = getConfig('.')
|
|
DBPools(config.databases)
|
|
dbname = get_module_dbname('entcms')
|
|
sor = DBPools().sqlorContext(dbname)
|
|
|
|
ns = {'sort': 'created_at desc'}
|
|
|
|
# data_filter support
|
|
filter_json = params_kw.get('data_filter', None)
|
|
if filter_json:
|
|
from sqlor.filter import DBFilter
|
|
try:
|
|
filter_def = json.loads(filter_json) if isinstance(filter_json, str) else filter_json
|
|
dbf = DBFilter(filter_def)
|
|
conds = dbf.gen(params_kw)
|
|
ns.update(conds)
|
|
ns.update(dbf.consts)
|
|
except Exception:
|
|
pass
|
|
|
|
# Manual filter params
|
|
|
|
_status = params_kw.get('status', None)
|
|
if _status:
|
|
ns['status'] = _status
|
|
|
|
_source = params_kw.get('source', None)
|
|
if _source:
|
|
ns['source'] = _source
|
|
|
|
rows = await sor.R('cms_leads', ns)
|
|
total = len(rows)
|
|
print(json.dumps({'status': 'ok', 'rows': rows, 'total': total}, ensure_ascii=False))
|