Add upstream stations types

This commit is contained in:
Fred Boniface 2024-06-28 15:05:31 +01:00
parent 86c599e17d
commit 7eb7b7ea0a
2 changed files with 19 additions and 58 deletions

View File

@ -2,19 +2,12 @@ package database
// Station Information
type Station struct {
CRS string `json:"3alpha"`
TIPLOC string `json:"tiploc"`
STANOX string `json:"stanox"`
Name string `json:"name"`
Location Location `json:"location"`
Operator string `json:"operator"`
Facilities Facilities `json:"facilities,omitempty"`
}
// Location Details
type Location struct {
Geo GeoJson `json:"geo,omitempty"`
Address Address `json:"address,omitempty"`
CRS string `json:"3ALPHA"`
TIPLOC string `json:"TIPLOC"`
STANOX string `json:"STANOX"`
NLCDESC string `json:"NLCDESC"`
Location GeoJson `json:"location"`
Operator string `json:"operator"`
}
// GeoJson Coordinates = [long, lat]
@ -22,48 +15,3 @@ type GeoJson struct {
Type string `json:"type"`
Coordinates []float64 `json:"coordinates"`
}
// Street address in five line format
type Address struct {
Line1 string `json:"line1,omitempty"`
Line2 string `json:"line2,omitempty"`
Line3 string `json:"line3,omitempty"`
Line4 string `json:"line4,omitempty"`
Line5 string `json:"line5,omitempty"`
}
// Station Facilities
type Facilities struct {
Staff bool
Cctv bool
Helppoint bool
Cis bool
Tvm bool
Seating bool
WaitingRoom bool
Buffet bool
Toilets bool
BabyChange bool
Telephones bool
InductionLoop bool
NKSToilets bool
Gateline bool
Cycle Cycle
CarPark CarPark
}
// Station Cycle Facilities
type Cycle struct {
CycleSpaces int64 `json:"cycleSpaces"`
AccessibleCycleSpaces int64 `json:"accessibleCycleSpaces"`
SpaceTypes []string `json:"spaceTypes,omitempty"`
Sheltered bool `json:"sheltered,omitempty"`
Cctv bool `json:"cctv,omitempty"`
}
// Station Carpark Facilities
type CarPark struct {
Spaces int64 `json:"spaces"`
AccessibleSpaces int64 `json:"accessibleSpaces"`
Cctv bool `json:"cctv,omitempty"`
}

View File

@ -0,0 +1,13 @@
package upstreamApi
type StationList struct {
Stations []Station `xml:"Station"`
}
type Station struct {
CrsCode string `xml:"CrsCode"`
Name string `xml:"Name"`
Longitude float64 `xml:"Longitude"`
Latitude float64 `xml:"Latitude"`
StationOperator string `xml:"StationOperator"`
}