- app/portal.py: 主入口,通过from cms.init import load_cms加载业务模块 - conf/config.json: 应用配置(ocai_cms数据库, 端口9090, cms模块wwwroot挂载到/cms) - wwwroot/: 公开页面(index/news/cases/products)和公开API - build.sh: 构建脚本(安装基础设施包+pip install cms模块+DDL/CRUD生成) - deploy.sh: 一键部署脚本(构建→建表→初始数据→权限→启动) - init_data.py: 从cms模块init/data.yaml加载初始数据 - init_any/superuser_permissions.py: RBAC权限初始化
19 lines
601 B
Plaintext
19 lines
601 B
Plaintext
|
|
config = getConfig('.')
|
|
DBPools(config.databases)
|
|
dbname = get_module_dbname('entcms')
|
|
async with db.sqlorContext(dbname) as sor:
|
|
|
|
ns = {'is_visible': '1', 'sort': 'sort_order asc'}
|
|
rows = await sor.R('cms_sections', ns)
|
|
# Parse JSON fields
|
|
for r in rows:
|
|
for field in ['display_config', 'style_config', 'static_content']:
|
|
v = r.get(field, None)
|
|
if v and isinstance(v, str):
|
|
try:
|
|
r[field] = json.loads(v)
|
|
except:
|
|
pass
|
|
return {'status': 'ok', 'rows': rows, 'total': len(rows)}
|