Update JournalController.java

pull/146/head
ruibaby 2019-04-27 00:53:58 +08:00
parent b61d24d7bd
commit 07d07e2170
1 changed files with 12 additions and 1 deletions

View File

@ -53,7 +53,7 @@ public class JournalController {
@ApiOperation("Gets latest journals") @ApiOperation("Gets latest journals")
public Page<JournalWithCmtCountDTO> pageBy(@PageableDefault(sort = "updateTime", direction = DESC) Pageable pageable, public Page<JournalWithCmtCountDTO> pageBy(@PageableDefault(sort = "updateTime", direction = DESC) Pageable pageable,
JournalQuery journalQuery) { JournalQuery journalQuery) {
Page<Journal> journalPage = journalService.pageBy(journalQuery,pageable); Page<Journal> journalPage = journalService.pageBy(journalQuery, pageable);
return journalService.convertToCmtCountDto(journalPage); return journalService.convertToCmtCountDto(journalPage);
} }
@ -80,6 +80,17 @@ public class JournalController {
return new JournalDTO().convertFrom(journalService.update(journal)); return new JournalDTO().convertFrom(journalService.update(journal));
} }
/**
* Delete journal by id.
*
* @param journalId journalId
*/
@DeleteMapping("{journalId:\\d+}")
@ApiOperation("Delete link by id")
public void deletePermanently(@PathVariable("journalId") Integer journalId) {
journalService.removeById(journalId);
}
@GetMapping("{journalId:\\d+}/comments/tree_view") @GetMapping("{journalId:\\d+}/comments/tree_view")
@ApiOperation("Lists comments with tree view") @ApiOperation("Lists comments with tree view")
public Page<BaseCommentVO> listCommentTree(@PathVariable("journalId") Integer journalId, public Page<BaseCommentVO> listCommentTree(@PathVariable("journalId") Integer journalId,