提交 ca3aa1e9 authored 作者: Whispa's avatar Whispa

commit

上级 54ec73fc
......@@ -21,7 +21,7 @@ public class LikeController {
@GetMapping(value = "/likesByPostId/{postId}")
//@PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')")
public List<PostLike> getList(@PathVariable(value = "postId") String id, @RequestParam(value = "pageNo") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize) {
return repository.findAllByPostId(id, PageRequest.of(pageNo, pageSize)).toList();
return repository.findAllByPost_Id(id, PageRequest.of(pageNo, pageSize)).toList();
}
......
......@@ -10,7 +10,7 @@ import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;
public interface LikeRepository extends PagingAndSortingRepository<PostLike, String> {
Page<PostLike> findAllByPostId(String postId, Pageable pageable);
Page<PostLike> findAllByPost_Id(String postId, Pageable pageable);
@Query(value = "delete from post_like WHERE user_info_user_id=:userId and post_id=:post",nativeQuery = true)
@Modifying
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论