- tools/{uuid,md5,random,time,ip}/index.go → 对应 <功能名>.go(git mv 保留历史)
- 目录名=包名=文件名三一致,扩展时目录内按功能加文件(ocr.go → + idcard.go + invoice.go)
- doc.go / AGENTS.md / PROJECT_STRUCTURE.md 同步规则说明
- 冒烟测试 5 端点全部通过
17 lines
546 B
Go
17 lines
546 B
Go
// Package random defines the GET /tools/random endpoint contract.
|
|
package random
|
|
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|
|
|
// RandomReq generates a random string.
|
|
type RandomReq struct {
|
|
g.Meta `path:"/tools/random" method:"get" tags:"Open/Tools" summary:"Generate a random string"`
|
|
Length int `json:"length" d:"16" v:"min:1|max:128#length must be 1-128"`
|
|
Type string `json:"type" d:"alnum" v:"in:alnum,digits,letters#unsupported type"`
|
|
}
|
|
|
|
// RandomRes is the response of RandomReq.
|
|
type RandomRes struct {
|
|
Value string `json:"value"`
|
|
}
|