Refactor looking up SIG reference details into a common location, taking it out of the individual spot providers. This means we can now look up references properly from Cluster spot comments, etc. Closes #74 as there is no longer any duplication of these lookups. Works towards #54 as sig_refs now specify their sig internally.

This commit is contained in:
Ian Renton
2025-11-02 15:45:19 +00:00
parent 28010a68ae
commit 286ff66721
22 changed files with 192 additions and 233 deletions

View File

@@ -493,7 +493,7 @@ paths:
tags:
- Utilities
summary: Look up SIG Ref details
description: Perform a lookup of data about a certain reference, providing the SIG and the ID of the reference.
description: Perform a lookup of data about a certain reference, providing the SIG and the ID of the reference. A SIGRef structure will be returned containing the SIG and ID, plus any other information Spothole could find about it.
operationId: sigref
parameters:
- name: sig
@@ -520,7 +520,7 @@ paths:
- WAB
- WAI
example: POTA
- name: sig_ref_id
- name: id
in: query
description: ID of a reference in that SIG
required: true
@@ -532,37 +532,9 @@ paths:
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: SIG reference name
example: Null Country Park
url:
type: string
description: SIG reference URL, which the user can look up for more information
example: "https://pota.app/#/park/GB-0001"
grid:
type: string
description: Maidenhead grid locator for the reference.
example: IO91aa
latitude:
type: number
description: Latitude of the reference, in degrees.
example: 51.2345
longitude:
type: number
description: Longitude of the reference, in degrees.
example: -1.2345
'404':
description: Reference not found, or SIG not supported
content:
application/json:
schema:
type: string
example: "Failed"
$ref: '#/components/schemas/SIGRef'
'422':
description: Validation error
description: Validation error e.g. SIG not supported or reference format incorrect
content:
application/json:
schema:
@@ -624,6 +596,28 @@ components:
type: string
description: SIG reference ID.
example: GB-0001
sig:
type: string
description: SIG that this reference is in.
enum:
- POTA
- SOTA
- WWFF
- WWBOTA
- GMA
- HEMA
- WCA
- MOTA
- SIOTA
- ARLHS
- ILLW
- ZLOTA
- IOTA
- WOTA
- BOTA
- WAB
- WAI
example: POTA
name:
type: string
description: SIG reference name
@@ -632,6 +626,18 @@ components:
type: string
description: SIG reference URL, which the user can look up for more information
example: "https://pota.app/#/park/GB-0001"
grid:
type: string
description: Maidenhead grid locator for the reference, if known.
example: IO91aa
latitude:
type: number
description: Latitude of the reference, in degrees, if known.
example: 51.2345
longitude:
type: number
description: Longitude of the reference, in degrees, if known.
example: -1.2345
Spot:
type: object
@@ -698,9 +704,10 @@ components:
example: -1.2345
dx_location_source:
type: string
description: Where we got the DX location (grid/latitude/longitude) from. If this was from the spot itself, it's likely quite accurate, but if we had to fall back to QRZ lookup, or even a location based on the DXCC itself, it will be a lot less accurate.
description: Where we got the DX location (grid/latitude/longitude) from. If this was from the spot itself, or from a lookup of the SIG ref (e.g. park) it's likely quite accurate, but if we had to fall back to QRZ lookup, or even a location based on the DXCC itself, it will be a lot less accurate.
enum:
- SPOT
- "SIG REF LOOKUP"
- "WAB/WAI GRID"
- QRZ
- DXCC
@@ -708,7 +715,7 @@ components:
example: SPOT
dx_location_good:
type: boolean
description: Does the software think the location is good enough to put a marker on a map? This is true if the source is "SPOT" or "WAB/WAI GRID", or alternatively if the source is "QRZ" and the callsign doesn't have a slash in it (i.e. operator likely at home).
description: Does the software think the location is good enough to put a marker on a map? This is true if the source is "SPOT", "SIG REF LOOKUP" or "WAB/WAI GRID", or alternatively if the source is "QRZ" and the callsign doesn't have a slash in it (i.e. operator likely at home).
example: true
de_call:
type: string