清理删除逻辑优化

This commit is contained in:
2025-05-28 10:34:18 +08:00
parent 06a07514cc
commit a41b87713f
5 changed files with 17 additions and 1 deletions

View File

@@ -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();
}

View File

@@ -54,4 +54,6 @@ public interface VideoMapper {
int deleteNotBuyRelations(Long scenicId, Date endDate);
int deleteNotBuyFaceRelations(Long userId, Long faceId);
int deleteUselessVideo();
}

View File

@@ -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);
});
}