@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 = "find", method = RequestMethod.GET, produces = "application/json") public List<Station> find() { return lineService.getPath("GVG", "BT"); }