| | |
| | | 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; |