diff options
Diffstat (limited to 'src/main/java/com/juick/www/api/activity')
-rw-r--r-- | src/main/java/com/juick/www/api/activity/converters/UserToActorConverter.java | 12 | ||||
-rw-r--r-- | src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java | 10 |
2 files changed, 3 insertions, 19 deletions
diff --git a/src/main/java/com/juick/www/api/activity/converters/UserToActorConverter.java b/src/main/java/com/juick/www/api/activity/converters/UserToActorConverter.java index 435cb50d..0ba047b5 100644 --- a/src/main/java/com/juick/www/api/activity/converters/UserToActorConverter.java +++ b/src/main/java/com/juick/www/api/activity/converters/UserToActorConverter.java @@ -13,15 +13,8 @@ import com.juick.www.api.activity.model.objects.Image; import com.juick.www.api.activity.model.objects.Key; import com.juick.www.api.activity.model.objects.Person; -import lombok.AllArgsConstructor; - -@AllArgsConstructor -public class UserToActorConverter implements Converter<User, Actor> { - - private ProfileUriBuilder profileUriBuilder; - private KeystoreManager keystoreManager; - private WebApp webApp; - +public record UserToActorConverter(ProfileUriBuilder profileUriBuilder, KeystoreManager keystoreManager, WebApp webApp) + implements Converter<User, Actor> { @Override public Actor convert(User user) { Actor profile = user.isService() ? new Application() : new Person(); @@ -44,5 +37,4 @@ public class UserToActorConverter implements Converter<User, Actor> { profile.setIcon(avatar); return (Actor) Context.build(profile); } - } diff --git a/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java b/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java index 8f5e7566..e10c3078 100644 --- a/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java +++ b/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java @@ -20,18 +20,10 @@ package com.juick.www.api.activity.helpers; import com.juick.model.Message; import com.juick.model.Tag; import com.juick.model.User; -import lombok.AllArgsConstructor; import org.springframework.web.util.UriComponents; import org.springframework.web.util.UriComponentsBuilder; -@AllArgsConstructor -public class ProfileUriBuilder { - private String baseUri; - - public String getBaseUri() { - return baseUri; - } - +public record ProfileUriBuilder(String baseUri) { public String inboxUri() { UriComponentsBuilder uri = UriComponentsBuilder.fromUriString(baseUri); return uri.replacePath("/api/inbox").toUriString(); |