source: bus-n-go-pavel-216049/bus-n-go-backend/src/main/kotlin/mk/ukim/finki/busngobackend/api/AdminController.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: 1.3 KB
Line 
1package mk.ukim.finki.busngobackend.api
2
3import mk.ukim.finki.busngobackend.service.AdminService
4import org.springframework.web.bind.annotation.*
5
6@RestController
7@RequestMapping("/api/admin")
8class AdminController(
9 private val adminService: AdminService,
10) {
11 @GetMapping("/average-time-between-stations")
12 fun getAvgTimeBetweenStations() = adminService.getAverageTimeBetweenStations()
13
14 @GetMapping("/fines-by-line")
15 fun getFinesByLine() = adminService.getFinesByLine()
16
17 @GetMapping("/commutes-by-hour")
18 fun getCommutesByHour() = adminService.getCommutesByHour()
19
20 @GetMapping("/commutes-by-line")
21 fun getCommutesByLine() = adminService.getCommutesByLine()
22
23 @GetMapping("/number-of-passengers-per-line-and-station")
24 fun getNumberOfPassengersPerLineAndStation() = adminService.getNumberOfPassengersByLineAndStation()
25
26 @GetMapping("/ticket-sales")
27 fun getTicketSales() = adminService.getTicketSales()
28
29 @GetMapping("/total-income")
30 fun getTotalIncome() = adminService.getTotalIncome()
31
32 @GetMapping("/all-users")
33 fun getAllUsers() = adminService.getAllUsers()
34
35 @PostMapping("/update-roles/{id}")
36 fun updateRolesForUser(
37 @PathVariable id: Long,
38 @RequestBody roles: List<String>,
39 ) = adminService.updateRolesForUser(id, roles)
40}
Note: See TracBrowser for help on using the repository browser.