This commit is contained in:
Vladimir Voronin
2025-01-07 12:35:17 +03:00
commit afd8e9f6d7
72 changed files with 4606 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
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<User> {
return userService.getById(id)
}
@GetMapping("/")
fun getUsers(): Mono<List<User>> {
// return ResponseEntity.ok("teset")
return userService.getUsers()
}
//
// @GetMapping("/regen")
// fun regenUsers(): ResponseEntity<Any> {
// return ResponseEntity.ok(userService.regenPass())
// }
}