package com.video.services.impl;

import com.video.model.utils.CommonResult;
import com.video.services.PlaybackRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: binguo
 * @Date: 2023/3/23 星期四 15:47
 * @Description: com.video.services.impl
 * @Version: 1.0
 */
@Service
public class PlaybackRecordImpl implements PlaybackRecordService {

//    @Autowired
//    private PlaybackRecordMapper playbackRecordMapper;
//
//    @Override
//    @CacheEvict(value = "PlaybackRecords", allEntries = true)//allEntries清除整个缓存区
//    public CommonResult<Integer> insertPlaybackRecord(PlaybackRecord playback) {
//
//        Integer result = playbackRecordMapper.insert(playback); // 帮我们自动生成id
//        return CommonResult.ok().setResult(result);// 发现，id会自动回填
//    }
//
//    @Override
//    @Cacheable("PlaybackRecords")
//    public CommonResult<List<PlaybackRecord>> getPlaybackRecords() {
//        List<PlaybackRecord> result = playbackRecordMapper.selectList(null);
//        return CommonResult.ok().setResult(result);
//    }
//

}
