From b67f2b80fad5413de4f7cd145942196cee861c63 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 4 Oct 2018 17:58:11 +0300 Subject: add Note endpoint --- .../src/main/java/com/juick/server/api/activity/Profile.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'juick-server/src/main/java/com/juick/server/api/activity') diff --git a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java index bbb7761f..76b82d79 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java @@ -1,5 +1,6 @@ package com.juick.server.api.activity; +import com.juick.Message; import com.juick.User; import com.juick.server.ActivityPubManager; import com.juick.server.KeystoreManager; @@ -220,6 +221,11 @@ public class Profile { } throw new HttpNotFoundException(); } + @GetMapping(value = "/m/{mid}", produces = {Context.LD_JSON_MEDIA_TYPE, Context.ACTIVITY_JSON_MEDIA_TYPE}) + public Context showNote(@PathVariable int mid) { + Message message = messagesService.getMessage(mid); + return Context.build(activityPubManager.makeNote(message)); + } @PostMapping(value = "/api/inbox", consumes = {Context.LD_JSON_MEDIA_TYPE, Context.ACTIVITY_JSON_MEDIA_TYPE}) public ResponseEntity processInbox(@RequestBody Activity activity, -- cgit v1.2.3