WuzzyLV / Skills_1-Backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Skills_1 Backend Hosted Here

Needs much improvement but works :)

Mappings

/routes

example:

[
	{
		"name":"Valmieras iela",
		"id":1
	},
	{
		"name":"Ģertrūdes iela",
		"id":2
	},
	{
		"name":"Nometņu iela",
		"id":3
	},
	{
		"name":"Imanta",
		"id":4
	},
	{
		"name":"Kreisā iela",
		"id":5
	},
	{
		"name":"Muižnieka iela",
		"id":6
	},
	{
		"name":"Anniņmuižas bulvāris",
		"id":7
	}
]

/route/{startID}/{endID}

example: /route/1/4

{
	"lines":[
		{
			"name":"Pirmais autobuss",
			"type":"bus",
			"id":1,
			"stops":[
				{
					"name":"Valmieras iela",
					"id":1
				},
				{
					"name":"Ģertrūdes iela",
					"id":2
				}
			]
		},
		{
			"name":"Otrais tramvajs",
			"type":"tram",
			"id":2,
			"stops":[
				{
					"name":"Ģertrūdes iela",
					"id":2
				},
				{
					"name":"Imanta",
					"id":4
				}
			]
		}
	]
}

Default routes

{
  "lines": [
    {
      "name": "Pirmais autobuss",
      "type": "bus",
      "id": 1,
      "stops": [
        {"name": "Valmieras iela", "id": 1},
        {"name": "Ģertrūdes iela", "id": 2},
        {"name": "Nometņu iela", "id": 3}
      ]
    },
    {
      "name": "Otrais tramvajs",
      "type": "tram",
      "id": 2,
      "stops": [
        {"name": "Imanta", "id": 4},
        {"name": "Ģertrūdes iela", "id": 2},
        {"name": "Kreisā iela", "id": 5}
      ]
    },
    {
      "name": "Trešais tramvajs",
      "type": "tram",
      "id": 3,
      "stops": [
        {"name": "Valmieras iela", "id": 1},
        {"name": "Muižnieka iela", "id": 6},
        {"name": "Anniņmuižas bulvāris", "id": 7}
      ]
    }
  ]
}

About


Languages

Language:Java 100.0%