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
pull/1541/head
guqing 2021-11-18 20:29:21 +08:00 committed by GitHub
parent c149d53f7e
commit 2ed5ef51c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -34,6 +34,7 @@ import run.halo.app.service.OptionService;
* Journal comment controller.
*
* @author johnniang
* @author guqing
* @date 2019-04-25
*/
@RestController
@ -106,6 +107,16 @@ public class JournalCommentController {
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+}")
@ApiOperation("Deletes comment permanently and recursively")
public BaseCommentDTO deleteBy(@PathVariable("commentId") Long commentId) {