feat: 附件上传
This commit is contained in:
@@ -14,7 +14,9 @@ package org.nl.dev.modular.file.provider;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.nl.dev.modular.file.entity.DevFile;
|
||||
import org.nl.dev.modular.file.enums.DevFileEngineTypeEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -81,4 +83,12 @@ public class DevFileApiProvider implements DevFileApi {
|
||||
.map(JSONUtil::parseObj)
|
||||
.orElse(new JSONObject());
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getFileInfoByUrl(String fileAddress) {
|
||||
return Optional.ofNullable(devFileService.getOne(new LambdaQueryWrapper<DevFile>()
|
||||
.eq(DevFile::getDownloadPath, fileAddress)))
|
||||
.map(JSONUtil::parseObj)
|
||||
.orElse(new JSONObject());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user