fix
wzy
2021-12-17 c3c6bbcd290da994c152495723c75a869185660f
src/main/java/cc/mrbird/febs/video/service/impl/VideoMasterInfoServiceImpl.java
@@ -223,11 +223,17 @@
        videoInfoVo.setTimeLength(currentItem.getTimeLength());
        if (loginUser != null) {
            VideoHistoryEntity history = new VideoHistoryEntity();
            history.setVideoId(videoInfoEntity.getId());
            history.setMemberId(loginUser.getId());
            history.setVideoItemId(currentItem.getId());
            this.videoHistoryMapper.insert(history);
            VideoHistoryEntity history = this.videoHistoryMapper.selectByMemberIdAndVideoId(loginUser.getId(), videoInfoEntity.getId());
            if (history == null) {
                history = new VideoHistoryEntity();
                history.setVideoId(videoInfoEntity.getId());
                history.setMemberId(loginUser.getId());
                history.setVideoItemId(currentItem.getId());
                this.videoHistoryMapper.insert(history);
            } else {
                history.setVideoItemId(currentItem.getId());
                this.videoHistoryMapper.updateById(history);
            }
        }
        return videoInfoVo;