diff options
Diffstat (limited to 'src/main/java/com/juick/www/api/activity/helpers')
-rw-r--r-- | src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java | 9 |
1 files changed, 8 insertions, 1 deletions
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 e10c3078..3f48502b 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 @@ -61,9 +61,16 @@ public record ProfileUriBuilder(String baseUri) { return messageUri(msg.getMid(), msg.getRid()); } + public static String messageId(Message msg) { + return messageId(msg.getMid(), msg.getRid()); + } + public static String messageId(int mid, int rid) { + return String.format("%d-%d", mid, rid); + } + public String messageUri(int mid, int rid) { UriComponentsBuilder uri = UriComponentsBuilder.fromUriString(baseUri); - uri.replacePath(String.format("/n/%d-%d", mid, rid)); + uri.replacePath("/n/" + messageId(mid, rid)); return uri.toUriString(); } |