@RequestMapping(value = "newcreate", method = RequestMethod.GET, produces = "application/json") public Line newCreate() { Station station1 = stationService.findByStationName("SK"); Station station2 = new Station(); station2.setStationName("BT"); station2 = stationService.create(station2); Line l = new Line(); l.setStartingStation(station1); l.setArrivingStation(station2); lineService.create(l); return l; }
@RequestMapping(value = "list", method = RequestMethod.GET, produces = "application/json") public Station list() { Station s = stationService.findByStationName("Gevgelija"); return stationService.findByStationId(s.getId()); }