|
|
@@ -7,10 +7,10 @@ import cn.reghao.autodop.dmaster.app.model.po.config.DeployConfig;
|
|
|
import cn.reghao.autodop.dmaster.machine.db.query.MachineHostQuery;
|
|
|
import cn.reghao.autodop.dmaster.notification.model.po.NotifyGroup;
|
|
|
import cn.reghao.autodop.dmaster.notification.model.po.NotifyType;
|
|
|
-import cn.reghao.autodop.dmaster.app.db.query.config.AppQuery;
|
|
|
-import cn.reghao.autodop.dmaster.app.db.query.config.ProjQuery;
|
|
|
-import cn.reghao.autodop.dmaster.app.db.query.config.CompilerQuery;
|
|
|
-import cn.reghao.autodop.dmaster.app.db.query.config.PackerQuery;
|
|
|
+import cn.reghao.autodop.dmaster.app.db.query.config.AppConfigQuery;
|
|
|
+import cn.reghao.autodop.dmaster.app.db.query.config.ProjConfigQuery;
|
|
|
+import cn.reghao.autodop.dmaster.app.db.query.config.CompilerConfigQuery;
|
|
|
+import cn.reghao.autodop.dmaster.app.db.query.config.PackerConfigQuery;
|
|
|
import cn.reghao.autodop.dmaster.app.db.query.config.RepoAuthQuery;
|
|
|
import cn.reghao.autodop.dmaster.app.model.po.config.AppConfig;
|
|
|
import cn.reghao.autodop.dmaster.app.model.vo.KeyValue;
|
|
|
@@ -39,22 +39,22 @@ import java.util.stream.Collectors;
|
|
|
@Controller
|
|
|
@RequestMapping("/app/config/app")
|
|
|
public class AppConfigPageController {
|
|
|
- private final AppQuery appQuery;
|
|
|
- private final ProjQuery projQuery;
|
|
|
+ private final AppConfigQuery appConfigQuery;
|
|
|
+ private final ProjConfigQuery projConfigQuery;
|
|
|
private final RepoAuthQuery repoAuthQuery;
|
|
|
- private final CompilerQuery compilerQuery;
|
|
|
- private final PackerQuery packerQuery;
|
|
|
+ private final CompilerConfigQuery compilerConfigQuery;
|
|
|
+ private final PackerConfigQuery packerConfigQuery;
|
|
|
private final MachineHostQuery hostQuery;
|
|
|
private final NotifyGroupRepository receiverRepository;
|
|
|
|
|
|
- public AppConfigPageController(AppQuery appQuery, ProjQuery projQuery, RepoAuthQuery repoAuthQuery,
|
|
|
- CompilerQuery compilerQuery, PackerQuery packerQuery, MachineHostQuery hostQuery,
|
|
|
+ public AppConfigPageController(AppConfigQuery appConfigQuery, ProjConfigQuery projConfigQuery, RepoAuthQuery repoAuthQuery,
|
|
|
+ CompilerConfigQuery compilerConfigQuery, PackerConfigQuery packerConfigQuery, MachineHostQuery hostQuery,
|
|
|
NotifyGroupRepository receiverRepository) {
|
|
|
- this.appQuery = appQuery;
|
|
|
- this.projQuery = projQuery;
|
|
|
+ this.appConfigQuery = appConfigQuery;
|
|
|
+ this.projConfigQuery = projConfigQuery;
|
|
|
this.repoAuthQuery = repoAuthQuery;
|
|
|
- this.compilerQuery = compilerQuery;
|
|
|
- this.packerQuery = packerQuery;
|
|
|
+ this.compilerConfigQuery = compilerConfigQuery;
|
|
|
+ this.packerConfigQuery = packerConfigQuery;
|
|
|
this.hostQuery = hostQuery;
|
|
|
this.receiverRepository = receiverRepository;
|
|
|
}
|
|
|
@@ -70,7 +70,7 @@ public class AppConfigPageController {
|
|
|
if (appName != null) {
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("appName", appName);
|
|
|
- List<AppConfig> list = appQuery.query(map);
|
|
|
+ List<AppConfig> list = appConfigQuery.query(map);
|
|
|
Page<AppConfig> page = new PageImpl<>(list);
|
|
|
PageList<AppConfig> pageList = PageList.pageList(page);
|
|
|
|
|
|
@@ -81,7 +81,7 @@ public class AppConfigPageController {
|
|
|
}
|
|
|
|
|
|
PageRequest pageRequest = PageSort.pageRequest();
|
|
|
- Page<AppConfig> appPage = appQuery.findByEnv(env, pageRequest);
|
|
|
+ Page<AppConfig> appPage = appConfigQuery.findByEnv(env, pageRequest);
|
|
|
PageList<AppConfig> pageList = PageList.pageList(appPage);
|
|
|
|
|
|
model.addAttribute("env", env);
|
|
|
@@ -103,7 +103,7 @@ public class AppConfigPageController {
|
|
|
notifyTypes.add(new KeyValue(notifyType.name(), notifyType.name()));
|
|
|
}
|
|
|
|
|
|
- List<KeyValue> projList = projQuery.queryAll(new HashMap<>()).stream()
|
|
|
+ List<KeyValue> projList = projConfigQuery.queryAll(new HashMap<>()).stream()
|
|
|
.map(proj -> new KeyValue(proj.getProjId(), proj.getProjName()))
|
|
|
.collect(Collectors.toList());
|
|
|
List<KeyValue> projs = new ArrayList<>();
|
|
|
@@ -151,11 +151,11 @@ public class AppConfigPageController {
|
|
|
.map(repoAuthConfig -> new KeyValue(String.valueOf(repoAuthConfig.getName()), repoAuthConfig.getName()))
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
- List<KeyValue> compilers = compilerQuery.findAllByIsDeleteFalse().stream()
|
|
|
+ List<KeyValue> compilers = compilerConfigQuery.findAllByIsDeleteFalse().stream()
|
|
|
.map(compilerConfig -> new KeyValue(String.valueOf(compilerConfig.getName()), compilerConfig.getName()))
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
- List<KeyValue> packers = packerQuery.findAllByIsDeleteFalse().stream()
|
|
|
+ List<KeyValue> packers = packerConfigQuery.findAllByIsDeleteFalse().stream()
|
|
|
.map(packerConfig -> new KeyValue(String.valueOf(packerConfig.getName()), packerConfig.getName()))
|
|
|
.collect(Collectors.toList());
|
|
|
model.addAttribute("repoAuths", repoAuths);
|
|
|
@@ -178,7 +178,7 @@ public class AppConfigPageController {
|
|
|
|
|
|
@GetMapping("/detail/{appId}")
|
|
|
public String appConfigPage(@PathVariable("appId") String appId, Model model) {
|
|
|
- AppConfig app = appQuery.findByAppId(appId);
|
|
|
+ AppConfig app = appConfigQuery.findByAppId(appId);
|
|
|
model.addAttribute("app", app);
|
|
|
return "/app/config/app/detail";
|
|
|
}
|