添加文件保存dubbo接口
parent
54f8586d1f
commit
77d5103605
|
|
@ -56,6 +56,21 @@ public class ZcloudImgFilesFacadeImpl implements ZcloudImgFilesFacade {
|
||||||
}
|
}
|
||||||
return resultFilePath;
|
return resultFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String saveFile(byte[] bytes, String fileName, String path) {
|
||||||
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
|
String filePath = ssoUser.getTenantId().toString() + "/" + DateUtil.getMonth() + "/" + path;
|
||||||
|
// 文件上传并获取上传路径
|
||||||
|
String resultFilePath = null;
|
||||||
|
try {
|
||||||
|
resultFilePath = Smb.saveFile(new ByteArrayInputStream(bytes),fileName, filePath);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return resultFilePath;
|
||||||
|
}
|
||||||
|
|
||||||
public static InputStream base64ToInputStream(String base64String) {
|
public static InputStream base64ToInputStream(String base64String) {
|
||||||
if (base64String == null || base64String.isEmpty()) {
|
if (base64String == null || base64String.isEmpty()) {
|
||||||
throw new IllegalArgumentException("Base64 string is null or empty");
|
throw new IllegalArgumentException("Base64 string is null or empty");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue