feat(image): 添加图片清理功能- 新增 FileStorageService 用于文件上传、下载和删除操作- 实现 ImageCleanupService 清理冗余图片

- 添加 ImageCleanupController 提供手动清理图片的 API
- 创建 ImageCleanupScheduler定时清理冗余图片
- 更新相关 Mapper 接口,增加必要的查询和删除方法
This commit is contained in:
2025-08-06 17:29:11 +08:00
parent 8cdba1c0e6
commit b28446c4b6
8 changed files with 211 additions and 2 deletions

View File

@@ -3,6 +3,8 @@ package com.test.bijihoudaun.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.test.bijihoudaun.entity.Image;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface ImageMapper extends BaseMapper<Image> {
@@ -11,4 +13,11 @@ public interface ImageMapper extends BaseMapper<Image> {
// 自定义方法根据Markdown文件ID获取关联图片
// List<Image> findByMarkdownId(Integer markdownId);
/**
* 获取所有图片记录
* @return 所有图片列表
*/
@Select("SELECT * FROM image")
List<Image> findAll();
}