无关风月
2024-09-14 3f481005be717250a2ea87ff9367aa84d6a3eb13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.xinquan.user.service.impl;
 
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xinquan.system.api.domain.AppUserViewingHistory;
import com.xinquan.user.mapper.AppUserViewingHistoryMapper;
import com.xinquan.user.service.AppUserViewingHistoryService;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * <p>
 * 用户观看历史 服务实现类
 * </p>
 *
 * @author mitao
 * @since 2024-09-06
 */
@Service
public class AppUserViewingHistoryServiceImpl extends
        ServiceImpl<AppUserViewingHistoryMapper, AppUserViewingHistory> implements
        AppUserViewingHistoryService {
 
    /**
     * 记录用户观看记录
     *
     * @param bizId       业务id
     * @param viewingType 观看类型 1=疗愈 2=课程
     */
    @Override
    public void saveViewingRecord(Long bizId, Integer viewingType) {
        AppUserViewingHistory appUserViewingHistory = new AppUserViewingHistory();
        appUserViewingHistory.setBizId(bizId);
        appUserViewingHistory.setViewingType(viewingType);
        this.save(appUserViewingHistory);
    }
 
    @Override
    public List<AppUserViewingHistory> cumulative(Long userId) {
        return this.baseMapper.cumulative(userId);
    }
 
    @Override
    public int today(Long userId) {
        return this.baseMapper.today(userId);
    }
}