|
|
|
@ -12,6 +12,8 @@
|
|
|
|
|
*/
|
|
|
|
|
package vip.xiaonuo.dev.modular.file.provider;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import jakarta.annotation.Resource;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
@ -19,6 +21,8 @@ import vip.xiaonuo.dev.api.DevFileApi;
|
|
|
|
|
import vip.xiaonuo.dev.modular.file.enums.DevFileEngineTypeEnum;
|
|
|
|
|
import vip.xiaonuo.dev.modular.file.service.DevFileService;
|
|
|
|
|
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 文件API接口提供者
|
|
|
|
|
*
|
|
|
|
@ -70,4 +74,11 @@ public class DevFileApiProvider implements DevFileApi {
|
|
|
|
|
public String storageFileWithReturnIdMinio(MultipartFile file) {
|
|
|
|
|
return devFileService.uploadReturnId(DevFileEngineTypeEnum.MINIO.getValue(), file);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getFileInfoById(String id) {
|
|
|
|
|
return Optional.ofNullable(devFileService.getById(id))
|
|
|
|
|
.map(JSONUtil::parseObj)
|
|
|
|
|
.orElse(new JSONObject());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|