Files
jackyu66gitandCursor 879bf70cb7
ci / h5 (push) Canceled after 0s
ci / api (push) Canceled after 0s
ci / ess-docs (push) Canceled after 0s
feat(ECR-006): 落地运营后台 Phase A(admin API + admin-h5)
新增独立鉴权的 /api/v1/admin 与 Vue 控制台;会员授予与审计同事务,并补集成/单测。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 18:35:53 +08:00

57 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Architecture
Go 包边界(冻结):[architecture/go-services.md](architecture/go-services.md)
Domain / ERD[domain/domain-map.md](domain/domain-map.md) · [domain/erd.md](domain/erd.md)
## Allowed call graph
```
UI (user-h5 / mini-program / admin-h5)
→ packages/sdk(或 admin 薄 api 客户端)
→ API Handler
→ Service
→ Repository
→ Database
```
Admin 路由挂 `/api/v1/admin/*`,鉴权与终端 `DeviceAuth` **隔离**(见 `feature-spec/ops-admin.md`)。
## Forbidden
- Handler → Database (skip Service/Repository)
- UI → Database
- UI direct `fetch` to raw URLs (must use `@yuxingu/sdk` or `src/api` thin wrapper)
- Service importing Handler
- Circular package imports
- Giant `utils` / `common` dump packages
## Monorepo map
| Path | Role |
|---|---|
| `apps/api` | Only backend |
| `apps/user-h5` | Primary client (Vue3+TS) |
| `apps/mini-program` | Scaffold only until tasked |
| `apps/admin-h5` | Ops Phase AECR-006 |
| `packages/sdk` | Multi-platform HTTP client |
| `packages/types` | Shared TS types |
| `packages/utils` | Pure helpers |
| `packages/ui` | Design tokens |
| Root HTML / `server.py` | Legacy — do not extend |
## Feature flow (mandatory when adding a feature)
```
API route + handler
→ service
→ repository (if persistence)
→ migration (if schema change)
→ SDK / types update
→ UI page or component
→ test for money/scoring/auth paths
→ OpenAPI touch if public API changed
→ self-review
```
Missing migration or skipping service layer = incomplete.