Просмотр исходного кода

给 mybatis mapper 中的多参数方法添加 @Param 注解

reghao 9 месяцев назад
Родитель
Сommit
b900b66c05

+ 1 - 1
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/PostAlbumMapper.java

@@ -18,5 +18,5 @@ public interface PostAlbumMapper extends BaseMapper<PostAlbum> {
     void updateAlbumCover(@Param("albumId") long albumId, @Param("coverUrl") String coverUrl);
 
     int countByCriteria(AlbumQuery albumQuery);
-    List<PostAlbum> findAlbumByPage(Page page, AlbumQuery albumQuery);
+    List<PostAlbum> findAlbumByPage(@Param("page") Page page, @Param("albumQuery") AlbumQuery albumQuery);
 }

+ 2 - 1
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoCategoryMapper.java

@@ -7,6 +7,7 @@ import cn.reghao.tnb.content.app.vod.model.po.VideoCategory;
 import cn.reghao.tnb.content.app.vod.model.query.CategoryQuery;
 import cn.reghao.tnb.content.app.vod.model.query.VideoQuery;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -21,5 +22,5 @@ public interface VideoCategoryMapper extends BaseMapper<VideoCategory> {
     @Deprecated
     VideoCategory findByRid(int rid);
     VideoCategory findById(int id);
-    List<VideoCategory> findVideoCategoryByPage(Page page, CategoryQuery categoryQuery);
+    List<VideoCategory> findVideoCategoryByPage(@Param("page") Page page, @Param("categoryQuery") CategoryQuery categoryQuery);
 }

+ 1 - 1
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoCategoryPostMapper.java

@@ -18,6 +18,6 @@ public interface VideoCategoryPostMapper extends BaseMapper<VideoCategoryPost> {
     void updateVideoCategoryPost(VideoCategoryPost videoCategoryPost);
 
     int countByCriteria(VideoQuery videoQuery);
-    List<VideoCategoryPost> findVideoCategoryPostByPage(Page page, VideoQuery videoQuery);
+    List<VideoCategoryPost> findVideoCategoryPostByPage(@Param("page") Page page, @Param("videoQuery") VideoQuery videoQuery);
     VideoCategoryPost findByCategoryIdAndUserId(@Param("categoryId") int categoryId, @Param("userId") long userId);
 }

+ 3 - 3
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoPostMapper.java

@@ -26,10 +26,10 @@ import java.util.List;
 public interface VideoPostMapper extends BaseMapper<VideoPost> {
     void updateVideoScope(VideoScopeUpdate videoScopeUpdate);
     void updateVideoInfo(VideoInfoUpdate videoInfoUpdate);
-    void updateVideoCover(String videoId, String coverUrl);
+    void updateVideoCover(@Param("videoId") String videoId, @Param("coverUrl") String coverUrl);
     void updateVideoFile(@Param("videoId") String videoId, @Param("videoInfo") VideoInfo videoInfo);
-    void updateVideoStatus(String videoId, int status);
-    void updateVideoPublish(String videoId, int status);
+    void updateVideoStatus(@Param("videoId") String videoId, @Param("status") int status);
+    void updateVideoPublish(@Param("videoId") String videoId, @Param("status") int status);
     void updateVideoCached(@Param("videoId") String videoId,
                            @Param("videoInfo") VideoInfo videoInfo,
                            @Param("channelId") int channelId);

+ 2 - 2
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoPostTagMapper.java

@@ -17,8 +17,8 @@ import java.util.List;
 public interface VideoPostTagMapper extends BaseMapper<VideoPostTag> {
     void updateSetScope(@Param("videoId") String videoId, @Param("scope") int scope);
 
-    int countVideosByTag(String tagId, List<Integer> scopes);
-    List<String> findVideosByPage(Page page, String tagId, List<Integer> scopes);
+    int countVideosByTag(@Param("tagId") String tagId, @Param("scopes") List<Integer> scopes);
+    List<String> findVideosByPage(@Param("page") Page page, @Param("tagId") String tagId, @Param("scopes") List<Integer> scopes);
 
     List<String> findVideoTags(String videoId);
     List<String> findByGroupBy();