- cms/: Python包(合并原entcms+dingdingflow) - init.py: 791行,load_cms()注册所有CRUD+审批函数 - dingtalk_client.py: 钉钉API客户端 - models/: 7个表定义JSON(5个CMS+2个DD) - json/: 7个CRUD定义JSON - wwwroot/: 管理后台CRUD页面和API(37个dspy) - init/data.yaml: 模块初始数据(appcodes/appcodes_kv/分类/栏目/配置) - scripts/load_path.py: RBAC权限配置 - pyproject.toml: pip-installable包定义 - 删除: app/, conf/, build.sh, entcms/, dingdingflow/等webapp文件 - 数据库访问统一为DBPools()+_get_dbname()动态模式
61 lines
1.3 KiB
Markdown
61 lines
1.3 KiB
Markdown
# CMS 内容管理模块
|
||
|
||
企业官网内容管理与钉钉审批工作流模块,基于Sage/bricks-framework开发。
|
||
|
||
## 功能
|
||
|
||
- **内容管理**: 新闻/案例/产品/Banner的统一CRUD,带发布审批状态流
|
||
- **分类管理**: 按content_type分组的层级分类
|
||
- **栏目管理**: 官网页面栏目配置
|
||
- **商机线索**: 网站访客提交 + AI抽取
|
||
- **站点配置**: Hero标语、页脚等KV配置
|
||
- **钉钉审批**: 内容发布审批工作流
|
||
|
||
## 数据库表
|
||
|
||
| 表名 | 用途 |
|
||
|------|------|
|
||
| cms_content | 统一内容表 |
|
||
| cms_categories | 内容分类 |
|
||
| cms_sections | 栏目管理 |
|
||
| cms_leads | 商机线索 |
|
||
| cms_site_config | 站点配置 |
|
||
| dd_approvals | 审批记录 |
|
||
| dd_approval_configs | 审批流程配置 |
|
||
|
||
## 安装
|
||
|
||
```bash
|
||
pip install -e ~/repos/cms
|
||
```
|
||
|
||
## 集成
|
||
|
||
在Web应用(app/portal.py)中:
|
||
|
||
```python
|
||
from cms.init import load_cms
|
||
|
||
def init():
|
||
load_cms()
|
||
```
|
||
|
||
## 初始数据
|
||
|
||
`init/data.yaml` 包含:
|
||
- appcodes/appcodes_kv: 枚举编码(content_type, content_status, lead_status等)
|
||
- cms_categories: 默认分类
|
||
- cms_site_config: 默认站点配置
|
||
- cms_sections: 默认栏目配置
|
||
- dd_approval_configs: 默认审批配置
|
||
|
||
## 环境变量 (钉钉审批)
|
||
|
||
```
|
||
DINGTALK_APP_KEY=xxx
|
||
DINGTALK_APP_SECRET=xxx
|
||
DINGTALK_AGENT_ID=xxx
|
||
```
|
||
|
||
缺少环境变量时自动使用mock响应。
|