|
@@ -18,6 +18,7 @@ import top.lvzhiqiang.dto.JavAllInfo4Uncensored;
|
|
|
import top.lvzhiqiang.entity.*;
|
|
import top.lvzhiqiang.entity.*;
|
|
|
import top.lvzhiqiang.enumeration.ResultCodeEnum;
|
|
import top.lvzhiqiang.enumeration.ResultCodeEnum;
|
|
|
import top.lvzhiqiang.exception.BusinessException;
|
|
import top.lvzhiqiang.exception.BusinessException;
|
|
|
|
|
+import top.lvzhiqiang.exception.ParameterException;
|
|
|
import top.lvzhiqiang.mapper.*;
|
|
import top.lvzhiqiang.mapper.*;
|
|
|
import top.lvzhiqiang.service.BgService;
|
|
import top.lvzhiqiang.service.BgService;
|
|
|
import top.lvzhiqiang.util.DateUtils;
|
|
import top.lvzhiqiang.util.DateUtils;
|
|
@@ -412,6 +413,55 @@ public class BgServiceImpl implements BgService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 删除影片
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param identificationCode
|
|
|
|
|
+ * @param parentTypeName
|
|
|
|
|
+ * @author lvzhiqiang
|
|
|
|
|
+ * 2022/5/29 12:59
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
|
|
+ public void delVideoInfo(String identificationCode, String parentTypeName, String allFlag) {
|
|
|
|
|
+ if (StringUtils.isNotEmpty(parentTypeName) && StringUtils.isEmpty(allFlag)) {
|
|
|
|
|
+ if (parentTypeName.contains("类别")) {
|
|
|
|
|
+ String videoGenres = parentTypeName.replace("(类别)", "");
|
|
|
|
|
+ VideoInfoGenres videoInfoGenres = videoInfoGenresMapper.findVideoInfoGenresByCodeAndName(identificationCode, videoGenres);
|
|
|
|
|
+ if ("1".equals(videoInfoGenres.getType())) {
|
|
|
|
|
+ // 主体
|
|
|
|
|
+ throw new ParameterException("上级类型名称为主体,请选用allFlag参数");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 链接
|
|
|
|
|
+ videoInfoGenresMapper.deleteById(videoInfoGenres.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (parentTypeName.contains("优")) {
|
|
|
|
|
+ String videoCast = "";
|
|
|
|
|
+ if (parentTypeName.contains("(男")) {
|
|
|
|
|
+ videoCast = parentTypeName.replace("(男优)", "");
|
|
|
|
|
+ } else if (parentTypeName.contains("(女")) {
|
|
|
|
|
+ videoCast = parentTypeName.replace("(女优)", "");
|
|
|
|
|
+ }
|
|
|
|
|
+ VideoInfoCast videoInfoCast = videoInfoCastMapper.findVideoInfoCastByCodeAndName(identificationCode, videoCast);
|
|
|
|
|
+ if ("1".equals(videoInfoCast.getType())) {
|
|
|
|
|
+ // 主体
|
|
|
|
|
+ throw new ParameterException("上级类型名称为主体,请选用allFlag参数");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 链接
|
|
|
|
|
+ videoInfoCastMapper.deleteById(videoInfoCast.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new ParameterException("直属类型不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (StringUtils.isEmpty(parentTypeName) && StringUtils.isNotEmpty(allFlag)) {
|
|
|
|
|
+ videoInfoMapper.delByIdentificationCode(identificationCode);
|
|
|
|
|
+ videoInfoCastMapper.deleteByCode(identificationCode);
|
|
|
|
|
+ videoInfoGenresMapper.deleteByCode(identificationCode);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new ParameterException("参数有误");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 初始化骑兵数据
|
|
* 初始化骑兵数据
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|