Files
zkxw/docs/superpowers/plans/2026-09-01-process-route-builtin-template.md
T
2026-09-01 11:32:49 +08:00

30 lines
1.2 KiB
Markdown

# 工艺路线内置模版 Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans.
**Goal:** 复制 4 条工艺路线为内置模版(`is_builtin=1`),非 `super_admin` 不可改删;提供可在测试/生产执行的幂等 SQL。
**Architecture:** 表字段 `is_builtin` + CRUD/API 写守卫 + 前端按 `isBuiltin`/`isSuperAdmin` 禁用操作;SQL 深拷贝路线及步骤子表。
**Tech Stack:** MySQL 5.7, FastAPI, Vue 3, Element Plus
**Spec:** `docs/superpowers/specs/2026-09-01-process-route-builtin-template-design.md`
---
## File map
| File | Responsibility |
|------|----------------|
| `docs/sql/2026-09-01-process-route-add-is-builtin.sql` | ALTER 加字段 |
| `docs/sql/2026-09-01-process-route-builtin-templates.sql` | 幂等深拷贝 4 条 |
| `backend/app/models/models.py` | `is_builtin` 列 |
| `backend/app/crud/process_route.py` | 序列化 + `assert_route_writable` |
| `backend/app/api/production.py` | 写接口调用守卫 |
| `backend/tests/test_process_route_builtin.py` | 守卫单测 |
| `web-admin/.../ProcessRouteTab.vue` | UI 禁用 |
Commits: 仅用户要求时提交。
---