aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Post.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Post.java b/juick-server/src/main/java/com/juick/server/api/Post.java
index 3b022aae..486e9c0f 100644
--- a/juick-server/src/main/java/com/juick/server/api/Post.java
+++ b/juick-server/src/main/java/com/juick/server/api/Post.java
@@ -263,7 +263,8 @@ public class Post {
@PostMapping("/react")
@ResponseStatus(value = HttpStatus.OK)
- public Status doPostReact(@RequestParam Integer mid,@RequestParam @NotNull int reactionId){
+ public Status doPostReact(@RequestParam Integer mid,@RequestParam @NotNull int reactionId,
+ @RequestParam (required = false, defaultValue = "1") int count) {
logger.info("got reaction with type: {}", reactionId);
com.juick.User visitor = UserUtils.getCurrentUser();
@@ -277,9 +278,10 @@ public class Post {
if (msg.getUser().getUid() == visitor.getUid()) {
throw new HttpForbiddenException();
}
-
- MessagesService.RecommendStatus recommendStatus = messagesService.likeMessage(mid,visitor.getUid(),
- reactionId);
+ MessagesService.RecommendStatus recommendStatus = MessagesService.RecommendStatus.Error;
+ for (int i = 0; i < count; i++)
+ recommendStatus = messagesService.likeMessage(mid, visitor.getUid(),
+ reactionId);
return recommendStatus == MessagesService.RecommendStatus.Error ? Status.ERROR :Status.OK;
}