source: bus-n-go-pavel-216049/bus-n-go-backend/src/main/kotlin/mk/ukim/finki/busngobackend/api/CommuteController.kt

Last change on this file was baf4cc4, checked in by ppaunovski <paunovskipavel@…>, 3 months ago

split group project and individual project into two separate folders

  • Property mode set to 100644
File size: 812 bytes
Line 
1package mk.ukim.finki.busngobackend.api
2
3import mk.ukim.finki.busngobackend.api.requests.StartCommuteRequest
4import mk.ukim.finki.busngobackend.service.CommuteService
5import org.springframework.web.bind.annotation.PutMapping
6import org.springframework.web.bind.annotation.RequestBody
7import org.springframework.web.bind.annotation.RequestMapping
8import org.springframework.web.bind.annotation.RestController
9
10@RestController
11@RequestMapping("/api/commutes")
12class CommuteController(
13 private val commuteService: CommuteService,
14) {
15 @PutMapping("/start")
16 fun startCommute(
17 @RequestBody request: StartCommuteRequest,
18 ) = commuteService.start(request)
19
20 // subscribe to the topic for that station
21 // receive the incoming route instances
22 // choose one as target and start commute
23}
Note: See TracBrowser for help on using the repository browser.