- api/common/v1 → api/open/v1,路由前缀 /api/common/v1 → /api/open/v1
- 契约层按子功能拆目录:api/open/v1/tools/{uuid,md5,random,time,ip}/index.go
- 控制器同步拆文件:internal/controller/open/{uuid,md5,random,time,ip}.go
- 命名规则(open 优于 common)与 tools 目录规则记入 AGENTS.md
- 冒烟测试:旧路由 404,新路由 5 端点全部通过
17 lines
503 B
Go
17 lines
503 B
Go
// Package time defines the GET /tools/time endpoint contract.
|
|
package time
|
|
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|
|
|
// TimeReq returns the current server time.
|
|
type TimeReq struct {
|
|
g.Meta `path:"/tools/time" method:"get" tags:"Open/Tools" summary:"Current server time"`
|
|
}
|
|
|
|
// TimeRes is the response of TimeReq.
|
|
type TimeRes struct {
|
|
Timestamp int64 `json:"timestamp"` // unix seconds
|
|
DateTime string `json:"dateTime"` // 2006-01-02 15:04:05
|
|
Date string `json:"date"` // 2006-01-02
|
|
}
|