Files
biji/biji-houdaun/src/main/java/com/test/bijihoudaun/service/ImageService.java
ikmkj 12ba82eaa1 feat(image): 添加图片删除功能并优化 Markdown 编辑器
- 在 ImageController 中添加删除图片的接口
- 在 ImageService 中实现删除图片和批量更新图片 ID 的方法
- 在前端集成复制代码插件并优化 Markdown 编辑器配置
- 修复后端分组相关接口的参数类型问题
2025-06-20 09:35:19 +08:00

50 lines
1.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package com.test.bijihoudaun.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.test.bijihoudaun.entity.Image;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List;
public interface ImageService extends IService<Image> {
/**
* 上传图片
* @param markdownId Markdown文件ID可选
* @param file 图片文件
* @return 上传的图片对象
* @throws IOException 文件操作异常
*/
Image uploadImage(Long markdownId, MultipartFile file) throws IOException;
/**
* 删除图片
* @param id 图片ID
* @return 是否删除成功
*/
boolean deleteImage(Long id);
/**
* 获取Markdown文件关联的图片
* @param markdownId Markdown文件ID
* @return 图片列表
*/
List<Image> getMarkdownImages(Long markdownId);
/**
* 根据URL删除图片
* @param url
* @return
*/
boolean deleteImageByUrl(String url);
/**
* 根据URL批量更新图片ID
* @param list
* @param markdownId
* @return
*/
boolean updateImageId(List<String> list, Long markdownId);
}