|
|
@@ -2,6 +2,7 @@ package cn.reghao.autodop.dmaster.app.controller;
|
|
|
|
|
|
import cn.reghao.autodop.common.config.BuildDeployResult;
|
|
|
import cn.reghao.autodop.dmaster.app.service.AppManager;
|
|
|
+import cn.reghao.autodop.dmaster.app.service.OssService;
|
|
|
import cn.reghao.autodop.dmaster.app.service.build.AppDeploy;
|
|
|
import cn.reghao.autodop.dmaster.result.WebResult;
|
|
|
import cn.reghao.autodop.dmaster.app.service.build.BuildDispatcher;
|
|
|
@@ -11,6 +12,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import org.tmatesoft.svn.core.SVNException;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.HashSet;
|
|
|
@@ -28,10 +30,12 @@ import java.util.Set;
|
|
|
public class BuildController {
|
|
|
private BuildDispatcher buildDispatcher;
|
|
|
private AppManager appManager;
|
|
|
+ private OssService ossService;
|
|
|
|
|
|
- public BuildController(BuildDispatcher buildDispatcher, AppManager appManager) {
|
|
|
+ public BuildController(BuildDispatcher buildDispatcher, AppManager appManager, OssService ossService) {
|
|
|
this.buildDispatcher = buildDispatcher;
|
|
|
this.appManager = appManager;
|
|
|
+ this.ossService = ossService;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "构建应用")
|
|
|
@@ -112,11 +116,10 @@ public class BuildController {
|
|
|
@ApiImplicitParam(name="appId", value="一个或多个应用(多个应用间使用 , 分隔)",
|
|
|
paramType="path", dataType = "String")
|
|
|
)
|
|
|
- @PostMapping("/deploy/oss")
|
|
|
- public String deployOss(@RequestParam("appId") String appId,
|
|
|
- @RequestParam("ossPath") String ossPath) throws Exception {
|
|
|
- // TODO 上传静态资源到 OSS
|
|
|
- return null;
|
|
|
+ @PostMapping("/deploy/oss/{appId}")
|
|
|
+ public String deployOss(@PathVariable("appId") String appId) throws SVNException {
|
|
|
+ ossService.upload(appId);
|
|
|
+ return new WebResult<String>().jsonResult("ok");
|
|
|
}
|
|
|
|
|
|
/**
|