|
|
@@ -521,6 +521,65 @@ public class BgServiceImpl implements BgService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 增加影片
|
|
|
+ *
|
|
|
+ * @param identificationCode
|
|
|
+ * @param videoName
|
|
|
+ * @param parentType
|
|
|
+ * @param parentName
|
|
|
+ * @param type
|
|
|
+ * @author lvzhiqiang
|
|
|
+ * 2022/9/27 20:54
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
+ public void insertVideoInfo(String identificationCode, String videoName, Integer parentType, String parentName, Integer type) {
|
|
|
+ String parentFullName;
|
|
|
+ if (parentType == 1) {
|
|
|
+ parentFullName = "(类别)" + parentName;
|
|
|
+
|
|
|
+ VideoInfoGenres videoInfoGenres = new VideoInfoGenres();
|
|
|
+ videoInfoGenres.setIdentificationCode(identificationCode);
|
|
|
+ videoInfoGenres.setName(parentName);
|
|
|
+ videoInfoGenres.setType(type);
|
|
|
+ videoInfoGenresMapper.insert(videoInfoGenres);
|
|
|
+ } else if (parentType == 2) {
|
|
|
+ parentFullName = "(男优)" + parentName;
|
|
|
+
|
|
|
+ VideoInfoCast videoInfoCast = new VideoInfoCast();
|
|
|
+ videoInfoCast.setIdentificationCode(identificationCode);
|
|
|
+ videoInfoCast.setName(parentName);
|
|
|
+ videoInfoCast.setType(type);
|
|
|
+ videoInfoCastMapper.insert(videoInfoCast);
|
|
|
+ } else if (parentType == 3) {
|
|
|
+ parentFullName = "(女优)" + parentName;
|
|
|
+
|
|
|
+ VideoInfoCast videoInfoCast = new VideoInfoCast();
|
|
|
+ videoInfoCast.setIdentificationCode(identificationCode);
|
|
|
+ videoInfoCast.setName(parentName);
|
|
|
+ videoInfoCast.setType(type);
|
|
|
+ videoInfoCastMapper.insert(videoInfoCast);
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("parentType类型错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 主体
|
|
|
+ if (type == 1) {
|
|
|
+ VideoInfo videoInfo = new VideoInfo();
|
|
|
+ videoInfo.setIdentificationCode(identificationCode);
|
|
|
+ videoInfo.setType(1);
|
|
|
+ // 视频URL
|
|
|
+ videoInfo.setVideoUrl(parentFullName.concat("/").concat(videoName));
|
|
|
+ // 修改时间
|
|
|
+ videoInfo.setCreateTime(LocalDateTime.now());
|
|
|
+ // 主体是谁
|
|
|
+ videoInfo.setMainWho(parentFullName);
|
|
|
+
|
|
|
+ videoInfoMapper.insert(videoInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 初始化骑兵数据
|
|
|
*/
|
|
|
@Override
|