This commit is contained in:
wenfp
2026-07-27 16:36:33 +08:00
parent 53f48de2b7
commit 7f819cd775
19 changed files with 623 additions and 173 deletions
+16
View File
@@ -16,6 +16,9 @@
- `app/routers/todos.py`Todo 接口,提供 `/todos` 的增删改查。
- `app/routers/temples.py`:寺院管理接口,提供 `/temples` 的增删改查。
- `app/routers/products.py`:商品管理接口,提供 `/products` 的增删改查。
- `app/routers/feature_icons.py`:图标管理接口,提供 `/feature-icons` 的增删改查和跨寺院复制。
- `app/routers/ad_slots.py`:广告位管理接口,提供广告位置 `/ad-slots` 的增删改查。
- `app/routers/ads.py`:广告管理接口,提供绑定广告位的 `/ads` 增删改查。
- `app/routers/orders.py`:订单管理接口,提供 `/orders` 的增删改查。
- `app/routers/payments.py`:微信支付接口,提供 JSAPI 预下单和支付通知处理。
- `app/routers/deploy.py`:自动部署 webhook 接口,供 Gitea 推送后触发前端构建。
@@ -39,6 +42,9 @@ DATABASE_PATH=/tmp/py-web.sqlite3 .venv/bin/uvicorn index:app --reload
- `front/src/views/temples/TempleManagement.vue`:寺院管理页面。
- `front/src/views/products/ProductManagement.vue`:商品管理页面。
- `front/src/views/products/ProductDetail.vue`:商品新建和编辑页面。
- `front/src/views/feature-icons/FeatureIconManagement.vue`:图标管理页面。
- `front/src/views/ad-slots/AdSlotManagement.vue`:广告位管理页面。
- `front/src/views/ads/AdManagement.vue`:广告管理页面。
- `front/src/views/orders/OrderManagement.vue`:订单管理页面。
- `front/src/views/rituals/RitualManagement.vue`:法事管理页面。
- `front/src/views/users/UserManagement.vue`:用户管理页面,调用后端 `/users` 接口。
@@ -47,6 +53,9 @@ DATABASE_PATH=/tmp/py-web.sqlite3 .venv/bin/uvicorn index:app --reload
- `front/src/api/users.ts`:用户接口封装。
- `front/src/api/uploads.ts`:图片上传接口封装。
- `front/src/api/payments.ts`:微信支付接口封装。
- `front/src/api/featureIcons.ts`:图标管理接口封装。
- `front/src/api/adSlots.ts`:广告位管理接口封装。
- `front/src/api/ads.ts`:广告管理接口封装。
前端更细的模块约定见 `front/AGENTS.md`,后端更细的模块约定见 `app/AGENTS.md`
@@ -58,6 +67,9 @@ DATABASE_PATH=/tmp/py-web.sqlite3 .venv/bin/uvicorn index:app --reload
/products 商品管理
/products/create 新建商品
/products/:productId/edit 编辑商品
/feature-icons 图标管理
/ad-slots 广告位管理
/ads 广告管理
/orders 订单管理
/ritual-services 法事管理
/users 用户管理
@@ -66,6 +78,7 @@ DATABASE_PATH=/tmp/py-web.sqlite3 .venv/bin/uvicorn index:app --reload
前端通过 Vite 代理把 `/api/*` 转发到 FastAPI 后端,默认目标是 `http://127.0.0.1:8000`
商品、订单、法事属于寺院隔离数据。前端通过顶部寺院选择器维护当前寺院,并在请求头 `X-Temple-Id` 中传给后端;后端按该寺院过滤数据。
图标、广告位和广告同样属于寺院隔离数据;广告位是首页广告、详情页广告、支付页广告等位置定义,广告是绑定到广告位的投放内容;图标支持从其他寺院复制到当前寺院,应用类型图标复制后需重新选择当前寺院商品。
## 依赖与运行约定
@@ -116,3 +129,6 @@ pnpm dev
- 2026-07-27:新增 Gitea 自动部署 webhook,后端 `/deploy/webhook` 校验 Gitea HMAC 签名或部署 token 后执行 `scripts/deploy_front.sh`,脚本负责拉取代码、安装前端依赖并执行 `pnpm build`;新增 `.env.example` 记录部署环境变量。验证:后端编译通过,webhook 密钥与 Gitea 签名校验测试通过。
- 2026-07-27:自动部署 webhook 从同步构建调整为后台构建,接口校验通过后立即返回 `202 accepted`,后台执行结果写入 `DEPLOY_LOG_PATH`,避免 Gitea Delivery 等待前端构建超时。验证:后端编译通过,webhook 后台任务触发测试通过。
- 2026-07-27:移除前端 Todo 占位模块,删除 `/todos` 前端路由、侧边栏入口和占位页面;后端 Todo 接口保留。验证:前端类型检查和构建通过。
- 2026-07-27:新增图标管理和广告位管理模块,后端新增 `feature_icons``ad_slots` 表及寺院隔离 CRUD 接口,图标支持跨寺院复制;前端新增图标管理、广告位管理 API、页面、路由和菜单入口,图片上传复用 OSS 上传接口。验证:后端编译通过,前端 `pnpm typecheck``pnpm build` 通过。
- 2026-07-27:广告模型拆分为广告位和广告,广告位仅表示首页广告、详情页广告、支付页广告等位置,新增 `ads` 表和 `/ads` 接口维护投放内容并绑定广告位;前端新增广告管理菜单和页面,广告位页面改为位置配置。验证:后端编译通过,广告位与广告接口冒烟测试通过,前端 `pnpm typecheck``pnpm build` 通过。
- 2026-07-27:优化前端构建拆包,路由页面改为懒加载,Ant Design Vue 改为组件级 ES 导入以支持 tree shakingVite `manualChunks` 拆分 Vue、Antd、图标、富文本编辑器和公共依赖包,并按实际常用组件包设置体积提示阈值。验证:`pnpm typecheck``pnpm build` 通过。