Sfoglia il codice sorgente

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

reghao 9 mesi fa
parent
commit
3afa526568

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

@@ -19,6 +19,6 @@ public interface PlayRecordMapper extends BaseMapper<PlayRecord> {
     Double findCurrentTime(@Param("userId") long userId, @Param("videoId") String videoId);
     Long findMaxId(long userId);
     int countUserRecord(long userId);
-    List<VideoRecord> findUserRecordByPage1(int pageSize, long nextId, long userId);
+    List<VideoRecord> findUserRecordByPage1(@Param("pageSize") int pageSize, @Param("nextId") long nextId, @Param("userId") long userId);
     PlayRecord findByUserIdAndVideoId(@Param("userId") long userId, @Param("videoId") String videoId);
 }

+ 2 - 1
user/user-service/src/main/java/cn/reghao/tnb/user/app/db/mapper/UserRelationMapper.java

@@ -4,6 +4,7 @@ import cn.reghao.jutil.jdk.db.BaseMapper;
 import cn.reghao.tnb.user.api.dto.UserInfo;
 import cn.reghao.tnb.user.app.model.po.UserRelation;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -16,7 +17,7 @@ public interface UserRelationMapper extends BaseMapper<UserRelation> {
     void deleteByUserRelation(long userId, long followingId);
 
     List<Long> findFollowingUsers(long userId);
-    UserRelation findRelation(long loginUserId, long userId);
+    UserRelation findRelation(@Param("loginUserId") long loginUserId, @Param("userId") long userId);
 
     int countUserFollower(long userId);
     List<Long> findUserFollowers(long userId);