You've already forked FrameTour-BE
清理删除逻辑优化
This commit is contained in:
@@ -79,4 +79,6 @@ public interface SourceMapper {
|
||||
List<SourceWatermarkEntity> listSourceWatermark(List<Long> sourceIds, Long faceId, String watermarkType);
|
||||
|
||||
void addSourceWatermark(Long sourceId, Long faceId, String type, String url);
|
||||
|
||||
int deleteUselessSource();
|
||||
}
|
||||
|
@@ -54,4 +54,6 @@ public interface VideoMapper {
|
||||
int deleteNotBuyRelations(Long scenicId, Date endDate);
|
||||
|
||||
int deleteNotBuyFaceRelations(Long userId, Long faceId);
|
||||
|
||||
int deleteUselessVideo();
|
||||
}
|
||||
|
@@ -163,7 +163,8 @@ public class FaceCleaner {
|
||||
int expireDay = scenicConfig.getVideoStoreDay();
|
||||
Date endDate = DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -expireDay);
|
||||
int deleteCount = videoMapper.deleteNotBuyRelations(scenic.getId(), endDate);
|
||||
log.info("当前景区{},删除VLOG{}个", scenic.getName(), deleteCount);
|
||||
int deleteVideoCount = videoMapper.deleteUselessVideo();
|
||||
log.info("当前景区{},删除VLOG关系{}个,删除VLOG记录{}个", scenic.getName(), deleteCount, deleteVideoCount);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -203,6 +204,8 @@ public class FaceCleaner {
|
||||
Date endDate2 = DateUtil.offsetDay(DateUtil.beginOfDay(new Date()), -imageSourceExpireDay);
|
||||
int deleteImageSourceCount = sourceMapper.deleteNotRelateSource(2, endDate2);
|
||||
log.info("当前景区{},删除原始图片素材{}个", scenic.getName(), deleteImageSourceCount);
|
||||
int deleteSourceCount = sourceMapper.deleteUselessSource();
|
||||
log.info("当前景区{},删除无用素材{}个", scenic.getName(), deleteSourceCount);
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user