source: bus-n-go-pavel-216049/bus-n-go-backend/src/main/kotlin/mk/ukim/finki/busngobackend/api/ControlsController.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: 626 bytes
Line 
1package mk.ukim.finki.busngobackend.api
2
3import mk.ukim.finki.busngobackend.service.ControlService
4import org.springframework.web.bind.annotation.*
5
6@RestController
7@RequestMapping("/api/controls")
8class ControlsController(
9 private val controlService: ControlService,
10) {
11 @GetMapping()
12 fun getControls() = controlService.getAllByConductor()
13
14 @PutMapping("/start")
15 fun start(
16 @RequestBody routeInstanceId: Long,
17 ) = controlService.start(routeInstanceId)
18
19 @GetMapping("/{controlId}/fines")
20 fun getFines(
21 @PathVariable controlId: Long,
22 ) = controlService.getFines(controlId)
23}
Note: See TracBrowser for help on using the repository browser.