Some changes
This commit is contained in:
parent
0a854f708a
commit
259b78ebd3
4 changed files with 193 additions and 9 deletions
|
|
@ -2,9 +2,11 @@ package api
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
|
@ -52,13 +54,13 @@ func init() {
|
|||
|
||||
func declareStationsRoutes(router *gin.RouterGroup) {
|
||||
router.GET("/stations/:type/:code", func(c *gin.Context) {
|
||||
code := convertLineType(string(c.Param("code")))
|
||||
code := convertLineCode(string(c.Param("code")))
|
||||
|
||||
var stations []PGStation
|
||||
for _, station := range IDFMStations {
|
||||
if station.Fields.Id == code {
|
||||
pgstation := PGStation{
|
||||
Id: station.Fields.StopId,
|
||||
Id: fmt.Sprintf("STIF:StopPoint:Q:%s:", strings.TrimPrefix(station.Fields.StopId, "IDFM:")),
|
||||
Name: station.Fields.StopName,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue