未验证 提交 2ed5ef51 编写于 作者: G guqing 提交者: GitHub

feat: add api for modifying journal comment content (#1536)

* feat: add api of modify comment content

* fix: remove update comment content api

* fix: remove comment content param
上级 c149d53f
...@@ -34,6 +34,7 @@ import run.halo.app.service.OptionService; ...@@ -34,6 +34,7 @@ import run.halo.app.service.OptionService;
* Journal comment controller. * Journal comment controller.
* *
* @author johnniang * @author johnniang
* @author guqing
* @date 2019-04-25 * @date 2019-04-25
*/ */
@RestController @RestController
...@@ -106,6 +107,16 @@ public class JournalCommentController { ...@@ -106,6 +107,16 @@ public class JournalCommentController {
return journalCommentService.convertTo(updatedJournalComment); return journalCommentService.convertTo(updatedJournalComment);
} }
@PutMapping("/{commentId:\\d+}")
@ApiOperation("Updates a journal comment by comment id")
public BaseCommentDTO updateCommentBy(@PathVariable Long commentId,
@RequestBody JournalCommentParam journalCommentParam) {
JournalComment commentToUpdate = journalCommentService.getById(commentId);
journalCommentParam.update(commentToUpdate);
return journalCommentService.convertTo(journalCommentService.update(commentToUpdate));
}
@DeleteMapping("{commentId:\\d+}") @DeleteMapping("{commentId:\\d+}")
@ApiOperation("Deletes comment permanently and recursively") @ApiOperation("Deletes comment permanently and recursively")
public BaseCommentDTO deleteBy(@PathVariable("commentId") Long commentId) { public BaseCommentDTO deleteBy(@PathVariable("commentId") Long commentId) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册