init
This commit is contained in:
@@ -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())
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user