feat(ip-location): implement IP location querying and GeoIP database management

This commit is contained in:
Tension
2025-11-23 22:38:55 +08:00
parent e3999ba75f
commit c4166cef6b
10 changed files with 237 additions and 1 deletions
+12
View File
@@ -17,6 +17,14 @@ type (
VersionResponse {
Version string `json:"version"`
}
QueryIPLocationRequest {
IP string `form:"ip" validate:"required"`
}
QueryIPLocationResponse {
Country string `json:"country"`
Region string `json:"region,omitempty"`
City string `json:"city"`
}
)
@server (
@@ -36,5 +44,9 @@ service ppanel {
@doc "Get Version"
@handler GetVersion
get /version returns (VersionResponse)
@doc "Query IP Location"
@handler QueryIPLocation
get /ip/location (QueryIPLocationRequest) returns (QueryIPLocationResponse)
}