|
@@ -11,6 +11,7 @@ import cn.com.qmth.examcloud.commons.util.FreeMarkerUtil;
|
|
|
import cn.com.qmth.examcloud.exchange.inner.service.UpyunService;
|
|
|
import cn.com.qmth.examcloud.exchange.inner.service.bean.UpyunPathEnvironmentInfo;
|
|
|
import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpYunClient;
|
|
|
+import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpYunPathInfo;
|
|
|
import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpyunSite;
|
|
|
import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpyunSiteManager;
|
|
|
|
|
@@ -27,27 +28,27 @@ public class UpyunServiceImpl implements UpyunService {
|
|
|
protected ExamCloudLog log = ExamCloudLogFactory.getLog(this.getClass());
|
|
|
|
|
|
@Override
|
|
|
- public String writeFile(String siteId, UpyunPathEnvironmentInfo env, InputStream in) {
|
|
|
+ public UpYunPathInfo writeFile(String siteId, UpyunPathEnvironmentInfo env, InputStream in) {
|
|
|
env.setCurrentTimeMillis(String.valueOf(System.currentTimeMillis()));
|
|
|
|
|
|
UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
|
|
|
UpYunClient upYunClient = UpyunSiteManager.getUpYunClient(siteId);
|
|
|
|
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
|
- String url = upYunClient.writeFile(path, in);
|
|
|
- return url;
|
|
|
+ UpYunPathInfo pathInfo = upYunClient.writeFile(path, in);
|
|
|
+ return pathInfo;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String writeFile(String siteId, UpyunPathEnvironmentInfo env, File file) {
|
|
|
+ public UpYunPathInfo writeFile(String siteId, UpyunPathEnvironmentInfo env, File file) {
|
|
|
env.setCurrentTimeMillis(String.valueOf(System.currentTimeMillis()));
|
|
|
|
|
|
UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
|
|
|
UpYunClient upYunClient = UpyunSiteManager.getUpYunClient(siteId);
|
|
|
|
|
|
String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
|
|
|
- String url = upYunClient.writeFile(path, file);
|
|
|
- return url;
|
|
|
+ UpYunPathInfo pathInfo = upYunClient.writeFile(path, file);
|
|
|
+ return pathInfo;
|
|
|
}
|
|
|
|
|
|
}
|