Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
a9527a23
Commit
a9527a23
authored
Aug 04, 2018
by
Junling Bu
Browse files
refact: 图片存储服务的API调整
parent
a7a7fed8
Changes
12
Hide whitespace changes
Inline
Side-by-side
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminStorageController.java
View file @
a9527a23
...
@@ -68,7 +68,7 @@ public class AdminStorageController {
...
@@ -68,7 +68,7 @@ public class AdminStorageController {
}
}
@PostMapping
(
"/create"
)
@PostMapping
(
"/create"
)
public
Object
create
(
@LoginAdmin
Integer
adminId
,
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
Object
create
(
@LoginAdmin
Integer
adminId
,
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
IOException
{
if
(
adminId
==
null
){
if
(
adminId
==
null
){
return
ResponseUtil
.
unlogin
();
return
ResponseUtil
.
unlogin
();
}
}
...
@@ -81,7 +81,7 @@ public class AdminStorageController {
...
@@ -81,7 +81,7 @@ public class AdminStorageController {
return
ResponseUtil
.
badArgumentValue
();
return
ResponseUtil
.
badArgumentValue
();
}
}
String
key
=
generateKey
(
originalFilename
);
String
key
=
generateKey
(
originalFilename
);
storageService
.
store
(
file
,
key
);
storageService
.
store
(
file
.
getInputStream
(),
file
.
getSize
(),
file
.
getContentType
()
,
key
);
String
url
=
storageService
.
generateUrl
(
key
);
String
url
=
storageService
.
generateUrl
(
key
);
LitemallStorage
storageInfo
=
new
LitemallStorage
();
LitemallStorage
storageInfo
=
new
LitemallStorage
();
...
...
litemall-core/pom.xml
View file @
a9527a23
...
@@ -81,12 +81,6 @@
...
@@ -81,12 +81,6 @@
<artifactId>
weixin-java-pay
</artifactId>
<artifactId>
weixin-java-pay
</artifactId>
<version>
3.0.0
</version>
<version>
3.0.0
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-test
</artifactId>
<version>
5.0.7.RELEASE
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
\ No newline at end of file
litemall-core/src/main/java/org/linlinjava/litemall/core/qcode/QCodeService.java
View file @
a9527a23
...
@@ -6,9 +6,7 @@ import org.linlinjava.litemall.core.storage.StorageService;
...
@@ -6,9 +6,7 @@ import org.linlinjava.litemall.core.storage.StorageService;
import
org.linlinjava.litemall.core.system.SystemConfig
;
import
org.linlinjava.litemall.core.system.SystemConfig
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.imageio.ImageIO
;
import
javax.imageio.ImageIO
;
import
java.awt.*
;
import
java.awt.*
;
...
@@ -41,9 +39,9 @@ public class QCodeService {
...
@@ -41,9 +39,9 @@ public class QCodeService {
FileInputStream
inputStream
=
new
FileInputStream
(
file
);
FileInputStream
inputStream
=
new
FileInputStream
(
file
);
//将商品图片,商品名字,商城名字画到模版图中
//将商品图片,商品名字,商城名字画到模版图中
byte
[]
imageData
=
drawPicture
(
inputStream
,
goodPicUrl
,
goodName
,
SystemConfig
.
getMallName
());
byte
[]
imageData
=
drawPicture
(
inputStream
,
goodPicUrl
,
goodName
,
SystemConfig
.
getMallName
());
MultipartFile
multipartFile
=
new
MockMultipartFile
(
file
.
getName
(),
file
.
getName
(),
"image/jpeg"
,
imageData
);
ByteArrayInputStream
inputStream2
=
new
ByteArrayInputStream
(
imageData
);
//存储分享图
//存储分享图
storageService
.
store
(
multipartFile
,
getKeyName
(
goodId
));
storageService
.
store
(
inputStream2
,
imageData
.
length
,
"image/jpeg"
,
getKeyName
(
goodId
));
}
catch
(
WxErrorException
e
)
{
}
catch
(
WxErrorException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
catch
(
FileNotFoundException
e
)
{
}
catch
(
FileNotFoundException
e
)
{
...
...
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/AliyunStorage.java
View file @
a9527a23
...
@@ -6,8 +6,8 @@ import com.aliyun.oss.model.PutObjectRequest;
...
@@ -6,8 +6,8 @@ import com.aliyun.oss.model.PutObjectRequest;
import
com.aliyun.oss.model.PutObjectResult
;
import
com.aliyun.oss.model.PutObjectResult
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.UrlResource
;
import
org.springframework.core.io.UrlResource
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.InputStream
;
import
java.net.MalformedURLException
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.net.URL
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
...
@@ -74,14 +74,14 @@ public class AliyunStorage implements Storage {
...
@@ -74,14 +74,14 @@ public class AliyunStorage implements Storage {
* 阿里云OSS对象存储简单上传实现
* 阿里云OSS对象存储简单上传实现
*/
*/
@Override
@Override
public
void
store
(
MultipartFile
fil
e
,
String
keyName
)
{
public
void
store
(
InputStream
inputStream
,
long
contentLength
,
String
contentTyp
e
,
String
keyName
)
{
try
{
try
{
// 简单文件上传, 最大支持 5 GB, 适用于小文件上传, 建议 20M以下的文件使用该接口
// 简单文件上传, 最大支持 5 GB, 适用于小文件上传, 建议 20M以下的文件使用该接口
ObjectMetadata
objectMetadata
=
new
ObjectMetadata
();
ObjectMetadata
objectMetadata
=
new
ObjectMetadata
();
objectMetadata
.
setContentLength
(
file
.
getSize
()
);
objectMetadata
.
setContentLength
(
contentLength
);
objectMetadata
.
setContentType
(
file
.
getC
ontentType
()
);
objectMetadata
.
setContentType
(
c
ontentType
);
// 对象键(Key)是对象在存储桶中的唯一标识。
// 对象键(Key)是对象在存储桶中的唯一标识。
PutObjectRequest
putObjectRequest
=
new
PutObjectRequest
(
bucketName
,
keyName
,
file
.
getI
nputStream
()
,
objectMetadata
);
PutObjectRequest
putObjectRequest
=
new
PutObjectRequest
(
bucketName
,
keyName
,
i
nputStream
,
objectMetadata
);
PutObjectResult
putObjectResult
=
getOSSClient
().
putObject
(
putObjectRequest
);
PutObjectResult
putObjectResult
=
getOSSClient
().
putObject
(
putObjectRequest
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ex
.
printStackTrace
();
...
...
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/LocalStorage.java
View file @
a9527a23
...
@@ -3,9 +3,9 @@ package org.linlinjava.litemall.core.storage;
...
@@ -3,9 +3,9 @@ package org.linlinjava.litemall.core.storage;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.UrlResource
;
import
org.springframework.core.io.UrlResource
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.net.MalformedURLException
;
import
java.net.MalformedURLException
;
import
java.nio.file.Files
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
...
@@ -47,9 +47,9 @@ public class LocalStorage implements Storage {
...
@@ -47,9 +47,9 @@ public class LocalStorage implements Storage {
}
}
@Override
@Override
public
void
store
(
MultipartFile
fil
e
,
String
keyName
)
{
public
void
store
(
InputStream
inputStream
,
long
contentLength
,
String
contentTyp
e
,
String
keyName
)
{
try
{
try
{
Files
.
copy
(
file
.
getI
nputStream
()
,
rootLocation
.
resolve
(
keyName
),
StandardCopyOption
.
REPLACE_EXISTING
);
Files
.
copy
(
i
nputStream
,
rootLocation
.
resolve
(
keyName
),
StandardCopyOption
.
REPLACE_EXISTING
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
"Failed to store file "
+
keyName
,
e
);
throw
new
RuntimeException
(
"Failed to store file "
+
keyName
,
e
);
}
}
...
...
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/Storage.java
View file @
a9527a23
package
org.linlinjava.litemall.core.storage
;
package
org.linlinjava.litemall.core.storage
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.InputStream
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
...
@@ -13,10 +13,12 @@ public interface Storage {
...
@@ -13,10 +13,12 @@ public interface Storage {
/**
/**
* 存储一个文件对象
* 存储一个文件对象
* @param file SpringBoot MultipartFile文件对象
* @param inputStream 文件输入流
* @param contentLength 文件长度
* @param contentType 文件类型
* @param keyName 文件索引名
* @param keyName 文件索引名
*/
*/
void
store
(
MultipartFile
fil
e
,
String
keyName
);
void
store
(
InputStream
inputStream
,
long
contentLength
,
String
contentTyp
e
,
String
keyName
);
Stream
<
Path
>
loadAll
();
Stream
<
Path
>
loadAll
();
...
...
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/StorageService.java
View file @
a9527a23
...
@@ -3,6 +3,7 @@ package org.linlinjava.litemall.core.storage;
...
@@ -3,6 +3,7 @@ package org.linlinjava.litemall.core.storage;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.InputStream
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
...
@@ -31,12 +32,13 @@ public class StorageService {
...
@@ -31,12 +32,13 @@ public class StorageService {
/**
/**
* 存储一个文件对象
* 存储一个文件对象
*
* @param inputStream 文件输入流
* @param file SpringBoot MultipartFile文件对象
* @param contentLength 文件长度
* @param keyName 文件索引名
* @param contentType 文件类型
* @param keyName 文件索引名
*/
*/
public
void
store
(
MultipartFile
fil
e
,
String
keyName
)
{
public
void
store
(
InputStream
inputStream
,
long
contentLength
,
String
contentTyp
e
,
String
keyName
)
{
storage
.
store
(
fil
e
,
keyName
);
storage
.
store
(
inputStream
,
contentLength
,
contentTyp
e
,
keyName
);
}
}
public
Stream
<
Path
>
loadAll
()
{
public
Stream
<
Path
>
loadAll
()
{
...
...
litemall-core/src/main/java/org/linlinjava/litemall/core/storage/TencentStorage.java
View file @
a9527a23
...
@@ -8,13 +8,10 @@ import com.qcloud.cos.model.ObjectMetadata;
...
@@ -8,13 +8,10 @@ import com.qcloud.cos.model.ObjectMetadata;
import
com.qcloud.cos.model.PutObjectRequest
;
import
com.qcloud.cos.model.PutObjectRequest
;
import
com.qcloud.cos.model.PutObjectResult
;
import
com.qcloud.cos.model.PutObjectResult
;
import
com.qcloud.cos.region.Region
;
import
com.qcloud.cos.region.Region
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.UrlResource
;
import
org.springframework.core.io.UrlResource
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.InputStream
;
import
java.net.MalformedURLException
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.net.URL
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
...
@@ -81,14 +78,14 @@ public class TencentStorage implements Storage {
...
@@ -81,14 +78,14 @@ public class TencentStorage implements Storage {
}
}
@Override
@Override
public
void
store
(
MultipartFile
fil
e
,
String
keyName
)
{
public
void
store
(
InputStream
inputStream
,
long
contentLength
,
String
contentTyp
e
,
String
keyName
)
{
try
{
try
{
// 简单文件上传, 最大支持 5 GB, 适用于小文件上传, 建议 20M以下的文件使用该接口
// 简单文件上传, 最大支持 5 GB, 适用于小文件上传, 建议 20M以下的文件使用该接口
ObjectMetadata
objectMetadata
=
new
ObjectMetadata
();
ObjectMetadata
objectMetadata
=
new
ObjectMetadata
();
objectMetadata
.
setContentLength
(
file
.
getSize
()
);
objectMetadata
.
setContentLength
(
contentLength
);
objectMetadata
.
setContentType
(
file
.
getC
ontentType
()
);
objectMetadata
.
setContentType
(
c
ontentType
);
// 对象键(Key)是对象在存储桶中的唯一标识。例如,在对象的访问域名 `bucket1-1250000000.cos.ap-guangzhou.myqcloud.com/doc1/pic1.jpg` 中,对象键为 doc1/pic1.jpg, 详情参考 [对象键](https://cloud.tencent.com/document/product/436/13324)
// 对象键(Key)是对象在存储桶中的唯一标识。例如,在对象的访问域名 `bucket1-1250000000.cos.ap-guangzhou.myqcloud.com/doc1/pic1.jpg` 中,对象键为 doc1/pic1.jpg, 详情参考 [对象键](https://cloud.tencent.com/document/product/436/13324)
PutObjectRequest
putObjectRequest
=
new
PutObjectRequest
(
bucketName
,
keyName
,
file
.
getI
nputStream
()
,
objectMetadata
);
PutObjectRequest
putObjectRequest
=
new
PutObjectRequest
(
bucketName
,
keyName
,
i
nputStream
,
objectMetadata
);
PutObjectResult
putObjectResult
=
getCOSClient
().
putObject
(
putObjectRequest
);
PutObjectResult
putObjectResult
=
getCOSClient
().
putObject
(
putObjectRequest
);
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
ex
.
printStackTrace
();
...
...
litemall-core/src/test/java/org/linlinjava/litemall/core/AliyunStorageTest.java
View file @
a9527a23
...
@@ -11,6 +11,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
...
@@ -11,6 +11,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
org.springframework.util.FileCopyUtils
;
import
org.springframework.util.FileCopyUtils
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -24,9 +25,8 @@ public class AliyunStorageTest {
...
@@ -24,9 +25,8 @@ public class AliyunStorageTest {
@Test
@Test
public
void
test
()
throws
IOException
{
public
void
test
()
throws
IOException
{
String
test
=
getClass
().
getClassLoader
().
getResource
(
"litemall.png"
).
getFile
();
String
test
=
getClass
().
getClassLoader
().
getResource
(
"litemall.png"
).
getFile
();
byte
[]
content
=
(
byte
[])
FileCopyUtils
.
copyToByteArray
(
new
FileInputStream
(
test
));
File
testFile
=
new
File
(
test
);
MockMultipartFile
mockMultipartFile
=
new
MockMultipartFile
(
"litemall.png"
,
"litemall.png"
,
"image/png"
,
content
);
aliyunStorage
.
store
(
new
FileInputStream
(
test
),
testFile
.
length
(),
"image/png"
,
"litemall.png"
);
aliyunStorage
.
store
(
mockMultipartFile
,
"litemall.png"
);
Resource
resource
=
aliyunStorage
.
loadAsResource
(
"litemall.png"
);
Resource
resource
=
aliyunStorage
.
loadAsResource
(
"litemall.png"
);
String
url
=
aliyunStorage
.
generateUrl
(
"litemall.png"
);
String
url
=
aliyunStorage
.
generateUrl
(
"litemall.png"
);
System
.
out
.
println
(
"test file "
+
test
);
System
.
out
.
println
(
"test file "
+
test
);
...
...
litemall-core/src/test/java/org/linlinjava/litemall/core/LocalStorageTest.java
View file @
a9527a23
...
@@ -6,11 +6,9 @@ import org.linlinjava.litemall.core.storage.LocalStorage;
...
@@ -6,11 +6,9 @@ import org.linlinjava.litemall.core.storage.LocalStorage;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
org.springframework.util.FileCopyUtils
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -24,9 +22,8 @@ public class LocalStorageTest {
...
@@ -24,9 +22,8 @@ public class LocalStorageTest {
@Test
@Test
public
void
test
()
throws
IOException
{
public
void
test
()
throws
IOException
{
String
test
=
getClass
().
getClassLoader
().
getResource
(
"litemall.png"
).
getFile
();
String
test
=
getClass
().
getClassLoader
().
getResource
(
"litemall.png"
).
getFile
();
byte
[]
content
=
(
byte
[])
FileCopyUtils
.
copyToByteArray
(
new
FileInputStream
(
test
));
File
testFile
=
new
File
(
test
);
MockMultipartFile
mockMultipartFile
=
new
MockMultipartFile
(
"litemall.png"
,
"litemall.png"
,
"image/jpeg"
,
content
);
localStorage
.
store
(
new
FileInputStream
(
test
),
testFile
.
length
(),
"image/png"
,
"litemall.png"
);
localStorage
.
store
(
mockMultipartFile
,
"litemall.png"
);
Resource
resource
=
localStorage
.
loadAsResource
(
"litemall.png"
);
Resource
resource
=
localStorage
.
loadAsResource
(
"litemall.png"
);
String
url
=
localStorage
.
generateUrl
(
"litemall.png"
);
String
url
=
localStorage
.
generateUrl
(
"litemall.png"
);
System
.
out
.
println
(
"test file "
+
test
);
System
.
out
.
println
(
"test file "
+
test
);
...
...
litemall-core/src/test/java/org/linlinjava/litemall/core/TencentStorageTest.java
View file @
a9527a23
...
@@ -6,11 +6,10 @@ import org.linlinjava.litemall.core.storage.TencentStorage;
...
@@ -6,11 +6,10 @@ import org.linlinjava.litemall.core.storage.TencentStorage;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
org.springframework.test.context.web.WebAppConfiguration
;
import
org.springframework.util.FileCopyUtils
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -24,9 +23,8 @@ public class TencentStorageTest {
...
@@ -24,9 +23,8 @@ public class TencentStorageTest {
@Test
@Test
public
void
test
()
throws
IOException
{
public
void
test
()
throws
IOException
{
String
test
=
getClass
().
getClassLoader
().
getResource
(
"litemall.png"
).
getFile
();
String
test
=
getClass
().
getClassLoader
().
getResource
(
"litemall.png"
).
getFile
();
byte
[]
content
=
(
byte
[])
FileCopyUtils
.
copyToByteArray
(
new
FileInputStream
(
test
));
File
testFile
=
new
File
(
test
);
MockMultipartFile
mockMultipartFile
=
new
MockMultipartFile
(
"litemall.png"
,
"litemall.png"
,
"image/png"
,
content
);
tencentStorage
.
store
(
new
FileInputStream
(
test
),
testFile
.
length
(),
"image/png"
,
"litemall.png"
);
tencentStorage
.
store
(
mockMultipartFile
,
"litemall.png"
);
Resource
resource
=
tencentStorage
.
loadAsResource
(
"litemall.png"
);
Resource
resource
=
tencentStorage
.
loadAsResource
(
"litemall.png"
);
String
url
=
tencentStorage
.
generateUrl
(
"litemall.png"
);
String
url
=
tencentStorage
.
generateUrl
(
"litemall.png"
);
System
.
out
.
println
(
"test file "
+
test
);
System
.
out
.
println
(
"test file "
+
test
);
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxStorageController.java
View file @
a9527a23
...
@@ -48,7 +48,7 @@ public class WxStorageController {
...
@@ -48,7 +48,7 @@ public class WxStorageController {
}
}
@PostMapping
(
"/upload"
)
@PostMapping
(
"/upload"
)
public
Object
upload
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
public
Object
upload
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
IOException
{
String
originalFilename
=
file
.
getOriginalFilename
();
String
originalFilename
=
file
.
getOriginalFilename
();
InputStream
inputStream
=
null
;
InputStream
inputStream
=
null
;
try
{
try
{
...
@@ -58,7 +58,7 @@ public class WxStorageController {
...
@@ -58,7 +58,7 @@ public class WxStorageController {
return
ResponseUtil
.
badArgumentValue
();
return
ResponseUtil
.
badArgumentValue
();
}
}
String
key
=
generateKey
(
originalFilename
);
String
key
=
generateKey
(
originalFilename
);
storageService
.
store
(
file
,
key
);
storageService
.
store
(
file
.
getInputStream
(),
file
.
getSize
(),
file
.
getContentType
()
,
key
);
String
url
=
storageService
.
generateUrl
(
key
);
String
url
=
storageService
.
generateUrl
(
key
);
LitemallStorage
storageInfo
=
new
LitemallStorage
();
LitemallStorage
storageInfo
=
new
LitemallStorage
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment