Go to file
夏犀麟 1486bb903f feat(api): 新增公共接口 api/common/v1(tools 工具端点)并修复 gtime 格式化
- api/common/v1/tools.go 契约 + internal/controller/common 实现:uuid/md5/random/time/ip
- cmd.go 注册 /api/common/v1 公开分组(无鉴权),复用 common/tools Go 包
- 修复 gtime v2.10.2 坑:Format 为 PHP 风格,Go layout 须用 Layout(),timex 封装为 Layout 语义
- 冒烟测试 5 端点全部通过;AGENTS.md / PROJECT_STRUCTURE.md / change-log 同步更新
2026-08-24 17:29:30 +08:00
api feat(api): 新增公共接口 api/common/v1(tools 工具端点)并修复 gtime 格式化 2026-08-24 17:29:30 +08:00
common feat(api): 新增公共接口 api/common/v1(tools 工具端点)并修复 gtime 格式化 2026-08-24 17:29:30 +08:00
docs/change-log feat(api): 新增公共接口 api/common/v1(tools 工具端点)并修复 gtime 格式化 2026-08-24 17:29:30 +08:00
hack feat(dev): 项目初始化。 2026-07-17 17:58:08 +08:00
internal feat(api): 新增公共接口 api/common/v1(tools 工具端点)并修复 gtime 格式化 2026-08-24 17:29:30 +08:00
manifest feat(dev): 项目初始化。 2026-07-17 17:58:08 +08:00
resource feat(dev): 项目初始化。 2026-07-17 17:58:08 +08:00
utility feat(dev): 项目初始化。 2026-07-17 17:58:08 +08:00
.gitattributes feat(dev): 项目初始化。 2026-07-17 17:58:08 +08:00
.gitignore feat(common): 新增公共模块 common/tools 及项目上下文记忆体系 2026-08-24 17:18:10 +08:00
AGENTS.md feat(api): 新增公共接口 api/common/v1(tools 工具端点)并修复 gtime 格式化 2026-08-24 17:29:30 +08:00
go.mod feat(dev): 项目初始化。 2026-07-17 17:58:08 +08:00
go.sum feat(dev): 项目初始化。 2026-07-17 17:58:08 +08:00
main.go feat(dev): 项目初始化。 2026-07-17 17:58:08 +08:00
Makefile feat(dev): 项目初始化。 2026-07-17 17:58:08 +08:00
PROJECT_STRUCTURE.md feat(api): 新增公共接口 api/common/v1(tools 工具端点)并修复 gtime 格式化 2026-08-24 17:29:30 +08:00
README.MD feat(dev): 项目初始化。 2026-07-17 17:58:08 +08:00

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 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.