- 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 端点全部通过
16 lines
432 B
Go
16 lines
432 B
Go
// Package ip defines the GET /tools/ip endpoint contract.
|
|
package ip
|
|
|
|
import "github.com/gogf/gf/v2/frame/g"
|
|
|
|
// IPReq returns the caller's IP information.
|
|
type IPReq struct {
|
|
g.Meta `path:"/tools/ip" method:"get" tags:"Open/Tools" summary:"Client IP info"`
|
|
}
|
|
|
|
// IPRes is the response of IPReq.
|
|
type IPRes struct {
|
|
IP string `json:"ip"`
|
|
Internal bool `json:"internal"` // whether the IP is a private/internal address
|
|
}
|