|
|
@@ -13,6 +13,7 @@ import java.io.IOException;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.UUID;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
@@ -27,6 +28,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
@Service
|
|
|
public class CommonServiceImpl implements ICommonService {
|
|
|
|
|
|
+ @Value("${oss.prefix.url}")
|
|
|
+ private String ossUrlPrefix;
|
|
|
@Autowired
|
|
|
private UploadToOssUtil uploadToOssUtil;
|
|
|
|
|
|
@@ -41,7 +44,8 @@ public class CommonServiceImpl implements ICommonService {
|
|
|
file.transferTo(tempFile);
|
|
|
uploadToOssUtil.upload(tempFile.getPath(), ossPath);
|
|
|
tempFile.deleteOnExit();
|
|
|
- return ResultData.ok(ossPath);
|
|
|
+ String url = this.ossUrlPrefix + ossPath;
|
|
|
+ return ResultData.ok(url);
|
|
|
|
|
|
}
|
|
|
}
|