|
|
@@ -3,6 +3,7 @@ package cn.reghao.devops.mgr.app.controller;
|
|
|
import cn.reghao.devops.mgr.app.service.AppBuildService;
|
|
|
import cn.reghao.devops.mgr.app.service.bd.BuildApp;
|
|
|
import cn.reghao.devops.mgr.app.service.bd.DeployApp;
|
|
|
+import cn.reghao.devops.mgr.app.service.bd.GetApp;
|
|
|
import cn.reghao.devops.mgr.app.service.webhook.WebhookService;
|
|
|
import cn.reghao.jutil.jdk.result.Result;
|
|
|
import cn.reghao.jutil.jdk.result.WebResult;
|
|
|
@@ -25,12 +26,15 @@ public class BuildDeployController {
|
|
|
private final DeployApp deployApp;
|
|
|
private final AppBuildService appBuildService;
|
|
|
private final WebhookService webhookService;
|
|
|
+ private final GetApp getApp;
|
|
|
|
|
|
- public BuildDeployController(BuildApp buildApp, DeployApp deployApp, AppBuildService appBuildService, WebhookService webhookService) {
|
|
|
+ public BuildDeployController(BuildApp buildApp, DeployApp deployApp, AppBuildService appBuildService,
|
|
|
+ WebhookService webhookService, GetApp getApp) {
|
|
|
this.buildApp = buildApp;
|
|
|
this.deployApp = deployApp;
|
|
|
this.appBuildService = appBuildService;
|
|
|
this.webhookService = webhookService;
|
|
|
+ this.getApp = getApp;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "构建部署应用", notes = "N")
|
|
|
@@ -86,4 +90,23 @@ public class BuildDeployController {
|
|
|
appBuildService.deleteBuildLog(buildLogId);
|
|
|
return WebResult.success();
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "构建包下载接口", notes = "N")
|
|
|
+ @GetMapping(value = "/packageurl/{buildLogId}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ @ResponseBody
|
|
|
+ public String packageUrl(@PathVariable("buildLogId") String buildLogId) throws Exception {
|
|
|
+ String packageUrl = getApp.packageUrl(buildLogId);
|
|
|
+ return WebResult.successWithMsg(packageUrl);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "构建包下载接口", notes = "N")
|
|
|
+ @GetMapping("/dl/{filename}")
|
|
|
+ public String dlPackage(@PathVariable("filename") String filename) {
|
|
|
+ try {
|
|
|
+ getApp.dlPackage(filename);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage());
|
|
|
+ }
|
|
|
+ return "redirect:/app/bd/build";
|
|
|
+ }
|
|
|
}
|