Commit 4b2cc094 authored by 黎博's avatar 黎博

新增获取docker项目类型接口

parent fb813a83
......@@ -22,7 +22,8 @@ public class DockerProjectController {
/**
* 获取docker project列表
* @param pageNum 第几页
*
* @param pageNum 第几页
* @param pageSize 每页多少个
* @return
*/
......@@ -30,7 +31,7 @@ public class DockerProjectController {
public JsonResult getDockerProjectList(String projectName, String projectType, boolean isActive,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "10") Integer pageSize) {
IPage projectIPage = dockerProjectService.getDockerProjectList(projectName, projectType, isActive, pageNum, pageSize);
IPage projectIPage = dockerProjectService.getDockerProjectList(projectName, projectType, isActive, pageNum, pageSize);
Map<String, Object> map = new HashMap<>();
map.put("total", projectIPage.getTotal());
map.put("list", projectIPage.getRecords());
......@@ -39,6 +40,7 @@ public class DockerProjectController {
/**
* 新增docker project
*
* @param dockerProject docker项目实体类
* @return
*/
......@@ -49,6 +51,7 @@ public class DockerProjectController {
/**
* 编辑docker project
*
* @param dockerProject docker项目实体类
* @return
*/
......@@ -59,6 +62,7 @@ public class DockerProjectController {
/**
* 删除docker project
*
* @param dockerProjectId 删除id
* @return
*/
......@@ -73,4 +77,11 @@ public class DockerProjectController {
dockerProjectQueryWrapper.eq("project_name", projectName);
return JsonResult.buildSuccessResult(dockerProjectService.getOne(dockerProjectQueryWrapper));
}
@GetMapping("/type")
public JsonResult getType() {
QueryWrapper<DockerProject> dockerProjectQueryWrapper = new QueryWrapper<>();
dockerProjectQueryWrapper.groupBy("project_type").select("project_type as projectType", "count(*) as total");
return JsonResult.buildSuccessResult(dockerProjectService.listMaps(dockerProjectQueryWrapper));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment