- 将 admin 相关服务移动到 internal/service/admin 目录下 - 更新控制器中的服务导入路径引用 - 移除已合并的服务文件 - 添加统一工作约定文档 - 更新 API 接口定义的包路径 |
||
|---|---|---|
| api | ||
| common | ||
| docs/change-log | ||
| hack | ||
| internal | ||
| manifest | ||
| resource | ||
| utility | ||
| .gitattributes | ||
| .gitignore | ||
| AGENTS.md | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| Makefile | ||
| PROJECT_STRUCTURE.md | ||
| README.MD | ||
Personal multi-client service
Layout
api → internal/controller → internal/service → internal/dao → internal/model(entity/do) is enforced. DTO and VO live in internal/model/dto and internal/model/vo; neither API types nor entities cross that boundary.
Database model generation
Run manifest/sql/001_core.sql on MySQL, set DB_DSN, then run:
gf gen dao -p internal -g default -gt -c
The command is intentionally the only source of internal/dao, internal/model/do, and internal/model/entity.
API isolation
/api/v1/*: user API, terminal header/body supportsmini,h5, andapp./admin/v1/*: admin API. Protected endpoints require both an admin access token and anX-Permissionidentifier.
Use GF_GCFG_FILE=config.dev.yaml (or config.test.yaml / config.prod.yaml) and set DB_DSN plus a strong JWT_SECRET before startup.