mirror of https://github.com/halo-dev/halo
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 parampull/1541/head
parent
c149d53f7e
commit
2ed5ef51c5
|
@ -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 {
|
||||||
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) {
|
||||||
|
|
Loading…
Reference in New Issue