diff --git a/src/main/java/icu/samnyan/aqua/net/UserRegistrar.kt b/src/main/java/icu/samnyan/aqua/net/UserRegistrar.kt index 9e30fada..e401f6a4 100644 --- a/src/main/java/icu/samnyan/aqua/net/UserRegistrar.kt +++ b/src/main/java/icu/samnyan/aqua/net/UserRegistrar.kt @@ -165,6 +165,11 @@ class UserRegistrar( @Doc("Get the information of the current logged-in user.", "User information") 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") @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 -> @@ -219,4 +224,4 @@ class UserRegistrar( SUCCESS } -} \ No newline at end of file +}