Remove deprecated method(remove) in CommentService

pull/137/head
johnniang 2019-02-25 19:07:42 +08:00
parent 2446b21650
commit 84740fdfea
3 changed files with 1 additions and 24 deletions

View File

@ -19,15 +19,6 @@ import java.util.Optional;
*/
public interface CommentService extends CrudService<Comment, Long> {
/**
*
*
* @param commentId commentId
* @return Optional
*/
@Deprecated
Optional<Comment> remove(Long commentId);
/**
*
*

View File

@ -48,20 +48,6 @@ public class CommentServiceImpl extends AbstractCrudService<Comment, Long> imple
return super.create(comment);
}
/**
*
*
* @param commentId commentId
* @return Optional
*/
@Override
@CacheEvict(value = {COMMENTS_CACHE_NAME, POSTS_CACHE_NAME}, allEntries = true, beforeInvocation = true)
public Optional<Comment> remove(Long commentId) {
final Optional<Comment> comment = this.fetchById(commentId);
commentRepository.delete(comment.orElse(null));
return comment;
}
/**
*
*

View File

@ -128,7 +128,7 @@ public class CommentController extends BaseController {
@RequestParam("status") Integer status,
@PageableDefault Pageable pageable) {
try {
commentService.remove(commentId);
commentService.removeById(commentId);
} catch (Exception e) {
log.error("Delete comment failed: {}", e.getMessage());
}