From adf3c2d3005b4dddcea32486ddd1ed58d7ab75b3 Mon Sep 17 00:00:00 2001 From: s Date: Thu, 6 Nov 2025 21:06:00 -0500 Subject: refactor: replace single map flag with separate google and osm options for bssid lookup --- internal/client/osint.go | 9 ++++++--- internal/models/osint.go | 20 +++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'internal') diff --git a/internal/client/osint.go b/internal/client/osint.go index 123cf32..98f42f3 100644 --- a/internal/client/osint.go +++ b/internal/client/osint.go @@ -1,9 +1,9 @@ package client import ( - "git.db.org.ai/dborg/internal/models" "encoding/json" "fmt" + "git.db.org.ai/dborg/internal/models" "net/url" ) @@ -14,8 +14,11 @@ func (c *Client) LookupBSSID(params *models.BSSIDParams) (*models.BSSIDLookupRes if params.All { queryParams.Add("all", "true") } - if params.Map { - queryParams.Add("map", "true") + if params.Google { + queryParams.Add("google", "true") + } + if params.OSM { + queryParams.Add("osm", "true") } data, err := c.Get(path, queryParams) diff --git a/internal/models/osint.go b/internal/models/osint.go index 7170c27..d403d57 100644 --- a/internal/models/osint.go +++ b/internal/models/osint.go @@ -1,9 +1,10 @@ package models type BSSIDParams struct { - BSSID string - All bool - Map bool + BSSID string + All bool + Google bool + OSM bool } type LocationInfo struct { @@ -13,16 +14,13 @@ type LocationInfo struct { } type BSSIDResult struct { - BSSID string `json:"bssid"` - Location *LocationInfo `json:"location"` - MapURL string `json:"map_url,omitempty"` + BSSID string `json:"bssid"` + Location *LocationInfo `json:"location"` + GoogleMap string `json:"google_map,omitempty"` + OpenStreetMap string `json:"openstreetmap,omitempty"` } -type BSSIDLookupResponse struct { - BSSID string `json:"bssid"` - Results []BSSIDResult `json:"results"` - MapURL string `json:"map_url,omitempty"` -} +type BSSIDLookupResponse []BSSIDResult type ErrorResponse struct { Error string `json:"error"` -- cgit v1.2.3