mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-14 02:47:27 +08:00
[+] User info endpoint
This commit is contained in:
@@ -165,6 +165,11 @@ class UserRegistrar(
|
|||||||
@Doc("Get the information of the current logged-in user.", "User information")
|
@Doc("Get the information of the current logged-in user.", "User information")
|
||||||
suspend fun getUser(@RP token: Str) = jwt.auth(token)
|
suspend fun getUser(@RP token: Str) = jwt.auth(token)
|
||||||
|
|
||||||
|
@API("/user-info")
|
||||||
|
@Doc("Get the information of a user by username.", "User information")
|
||||||
|
fun getUserInfo(@RP username: Str) =
|
||||||
|
userRepo.findByUsernameIgnoreCase(username)?.publicFields ?: (404 - "User not found")
|
||||||
|
|
||||||
@API("/setting")
|
@API("/setting")
|
||||||
@Doc("Validate and set a user setting field.", "Success message")
|
@Doc("Validate and set a user setting field.", "Success message")
|
||||||
suspend fun setting(@RP token: Str, @RP key: Str, @RP value: Str) = jwt.auth(token) { u ->
|
suspend fun setting(@RP token: Str, @RP key: Str, @RP value: Str) = jwt.auth(token) { u ->
|
||||||
|
|||||||
Reference in New Issue
Block a user