Files
biji/biji-houdaun/src/main/java/com/test/bijihoudaun/service/ImageService.java
ikmkj e8c460398c feat(biji-houdaun): 支持 Markdown 文件上传、预览、编辑和创建
- 新增 Markdown 文件预览功能
- 更新 Markdown 文件创建和编辑接口,使用 Long 类型的 ID
- 优化图片上传接口,支持 Long 类型的用户 ID 和 Markdown ID
- 重构 MarkdownFileService接口,增加获取 Markdown 文件的方法
- 修改 MarkdownFileServiceImpl 实现类,支持新的 Markdown 文件操作
2025-06-16 21:21:03 +08:00

43 lines
1.1 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 userId 用户ID
* @param markdownId Markdown文件ID可选
* @param file 图片文件
* @return 上传的图片对象
* @throws IOException 文件操作异常
*/
Image uploadImage(Long userId, Long markdownId, MultipartFile file) throws IOException;
/**
* 删除图片
* @param id 图片ID
* @param userId 用户ID用于权限验证
* @return 是否删除成功
*/
boolean deleteImage(Long id, Long userId);
/**
* 获取用户的图片列表
* @param userId 用户ID
* @return 图片列表
*/
List<Image> getUserImages(Long userId);
/**
* 获取Markdown文件关联的图片
* @param markdownId Markdown文件ID
* @return 图片列表
*/
List<Image> getMarkdownImages(Long markdownId);
}