Refactor geo re-resolve endpoint into geo_service and add typed response
This commit is contained in:
@@ -57,6 +57,19 @@ class GeoCacheStatsResponse(BaseModel):
|
||||
dirty_size: int = Field(..., description="Number of newly resolved entries not yet flushed to disk.")
|
||||
|
||||
|
||||
class GeoReResolveResponse(BaseModel):
|
||||
"""Response for ``POST /api/geo/re-resolve``.
|
||||
|
||||
Reports how many previously unresolved IPs were retried and how many
|
||||
gained a resolved country code after the re-resolve operation.
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(strict=True)
|
||||
|
||||
resolved: int = Field(..., description="Number of IPs successfully resolved.")
|
||||
total: int = Field(..., description="Number of IPs retried.")
|
||||
|
||||
|
||||
class IpLookupResponse(BaseModel):
|
||||
"""Response for ``GET /api/geo/lookup/{ip}``.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user