package space.luminic.budgerapp.controllers import org.slf4j.LoggerFactory import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RestController import reactor.core.publisher.Mono import space.luminic.budgerapp.models.User import space.luminic.budgerapp.services.UserService @RestController @RequestMapping("/users") class UsersController(val userService: UserService) { val logger = LoggerFactory.getLogger(javaClass) @GetMapping("/{id}") fun getUser(@PathVariable id: String): Mono { return userService.getById(id) } @GetMapping("/") fun getUsers(): Mono> { // return ResponseEntity.ok("teset") return userService.getUsers() } // // @GetMapping("/regen") // fun regenUsers(): ResponseEntity { // return ResponseEntity.ok(userService.regenPass()) // } }