- Timestamp:
- 02/04/24 16:57:49 (9 months ago)
- Branches:
- master
- Children:
- efaa053
- Parents:
- 07f4e8b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/tourMate/controllers/TransportController.java
r07f4e8b r0f5aa27 84 84 @PostMapping(path = "/transport/available/add") 85 85 public void add(@RequestBody TransportAvailible transportAvailable, @RequestParam(name = "transportId") long transportId) { 86 Transport t = transportManager.getTransportById(transportId); 87 List<TransportRoute> routes = transportAvailable.getRoutes().stream().toList(); 88 routes.get(0).setDeparture(transportAvailable.getDate()); 89 transportAvailable.setTime(routes.get(routes.size() - 1).getArrival()); 90 routes.forEach(x -> x.setParentRoute(transportAvailable)); 91 transportAvailable.setTransport(t); 92 transportManager.createTransportAvailable(transportAvailable.getTransport(), transportAvailable.getFrom(), transportAvailable.getTo(), transportAvailable.getDate(), transportAvailable.getFreeSpace(), transportAvailable.getTime(), routes); 86 87 transportManager.createTransportAvailable(transportAvailable, transportAvailable.getTransport(), transportAvailable.getFrom(), transportAvailable.getTo(), transportAvailable.getDate(), transportAvailable.getFreeSpace(), transportAvailable.getTime(), transportId, transportAvailable.getRoutes()); 93 88 } 94 89
Note:
See TracChangeset
for help on using the changeset viewer.