package com.ruoyi.member.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.member.domain.MemberFootprint;
import com.ruoyi.member.mapper.MemberFootprintMapper;
import com.ruoyi.member.service.IMemberFootprintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 浏览足迹Service业务层处理
 *
 * @author vinjor-m
 * @date 2025-03-17
 */
@Service
public class MemberFootprintServiceImpl extends ServiceImpl<MemberFootprintMapper, MemberFootprint> implements IMemberFootprintService {
    @Autowired
    private MemberFootprintMapper memberFootprintMapper;


    /**
     * 校验用户是否解锁过当前通告
     *
     * @param noticeId 通告id
     * @param userId   用户id
     * @return java.lang.Boolean
     * @author PQZ
     * @date 15:21 2025/4/18
     **/
    @Override
    public Boolean checkFoot(String noticeId, Long userId) {
        LambdaQueryWrapper<MemberFootprint> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(MemberFootprint::getNoticeId, noticeId)
                .eq(MemberFootprint::getUserId, userId);
        List<MemberFootprint> list = list(lambdaQueryWrapper);
        return list.isEmpty();
    }
}
