This repository has been archived on 2025-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
copy-kamanote/src/main/java/com/example/copykamanotes/mapper/NoteCollectMapper.java
LingandRX 341aadfe5a feat(model): 添加多个视图对象和 Redis 配置
- 新增 CategoryVO、CollectionVO、CommentVO 等多个视图对象
- 添加 RedisConfig 配置类
- 更新 RedisServiceImpl,移除不必要的 Qualifier 注解
- 修改 NoteMapper.xml,更新命名空间和结果映射
2025-03-31 22:25:12 +08:00

48 lines
1.1 KiB
Java

package com.example.copykamanotes.mapper;
import com.example.copykamanotes.model.entity.NoteCollect;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 笔记收藏Mapper接口
*/
@Mapper
public interface NoteCollectMapper {
/**
* 插入收藏记录
*
* @param noteCollect 收藏记录
* @return 影响的行数
*/
int insert(NoteCollect noteCollect);
/**
* 删除收藏记录
*
* @param noteId 笔记ID
* @param userId 用户ID
* @return 影响的行数
*/
int delete(@Param("noteId") Integer noteId, @Param("userId") Long userId);
/**
* 查找收藏记录
*
* @param noteId 笔记ID
* @param userId 用户ID
* @return 收藏记录
*/
NoteCollect findByNoteIdAndUserId(@Param("noteId") Integer noteId, @Param("userId") Long userId);
/**
* 获取用户收藏的笔记ID列表
*
* @param userId 用户ID
* @return 笔记ID列表
*/
List<Integer> findNoteIdsByUserId(@Param("userId") Long userId);
}