From 72e4cb42eb799afb62abba2306e1f9f29299735b Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Wed, 19 Jul 2023 20:16:05 +0100 Subject: [PATCH] Add JSON tags to database/timetable types --- pkg/database/timetable.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pkg/database/timetable.go b/pkg/database/timetable.go index 8c40222..ed234fc 100644 --- a/pkg/database/timetable.go +++ b/pkg/database/timetable.go @@ -5,24 +5,24 @@ import ( ) type Stop struct { - PublicDeparture *string - WttDeparture *string - PublicArrival *string - WttArrival *string - IsPublic bool - Tiploc string + PublicDeparture *string `json:"publicDeparture"` + WttDeparture *string `json:"wttDeparture"` + PublicArrival *string `json:"publicArrival"` + WttArrival *string `json:"wttArrival"` + IsPublic bool `json:"isPublic"` + Tiploc string `json:"tiploc"` } type Service struct { - TransactionType string - StpIndicator string - Operator string - TrainUid string - Headcode string - PowerType string - PlanSpeed string - ScheduleStartDate time.Time - ScheduleEndDate time.Time - DaysRun []string - Stops []Stop -} \ No newline at end of file + TransactionType string `json:"transactionType"` + StpIndicator string `json:"stpIndicator"` + Operator string `json:"operator"` + TrainUid string `json:"trainUid"` + Headcode string `json:"headcode"` + PowerType string `json:"powerType"` + PlanSpeed int32 `json:"planSpeed"` + ScheduleStartDate time.Time `json:"scheduleStartDate"` + ScheduleEndDate time.Time `json:"scheduleEndDate"` + DaysRun []string `json:"daysRun"` + Stops []Stop `json:"stops"` +}