23 lines
901 B
Go
23 lines
901 B
Go
# 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:
|
|
|
|
```powershell
|
|
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 supports `mini`, `h5`, and `app`.
|
|
- `/admin/v1/*`: admin API. Protected endpoints require both an admin access token and an `X-Permission` identifier.
|
|
|
|
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.
|