帖子post重提交
Change-Id: Ib28dc79d604faf43233c720031a4f18d84b22688
diff --git a/src/main/java/com/pt5/pthouduan/mapper/PostMapper.java b/src/main/java/com/pt5/pthouduan/mapper/PostMapper.java
index 6b95c73..0cd0480 100644
--- a/src/main/java/com/pt5/pthouduan/mapper/PostMapper.java
+++ b/src/main/java/com/pt5/pthouduan/mapper/PostMapper.java
@@ -39,7 +39,7 @@
int decrementLikes(@Param("postid") Integer postid);
// 设置置顶状态
- int updatePinnedStatus(@Param("postid") Integer postid, @Param("pinned") boolean pinned);
+ int updatePinnedStatus(@Param("postid") Integer postid, @Param("isPinned") boolean isPinned);
// 根据用户ID查询该用户所有帖子
List<Post> findByUserid(@Param("userid") Long userid);
@@ -47,6 +47,9 @@
// 查询所有置顶帖子
List<Post> findPinnedPosts();
- // ✅ 新增:查询所有帖子(置顶优先,时间倒序)
+ // ✅ 查询所有帖子(置顶优先,时间倒序)
List<Post> selectAllSorted();
+
+ // ✅ 根据帖子ID查询单个帖子(用于 togglePin 等功能)
+ Post selectById(@Param("postid") Integer postid);
}