Commit e740f5c9 authored by 黎博's avatar 黎博

Merge branch 'pipline'

parents 8aa3c51c ef8d1bf4
......@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
......@@ -56,9 +57,20 @@ public class PipelineController {
}
@GetMapping("/list")
public JsonResult getDingRobotAndPipelineList(@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
public JsonResult getDingRobotAndPipelineList(String jiraProjectKey, String projectName, String namespace,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "10") Integer pageSize) {
IPage<DingRobot> page = new Page<>(pageNum, pageSize);
QueryWrapper<DingRobot> dingRobotQueryWrapper = new QueryWrapper();
if (!StringUtils.isEmpty(jiraProjectKey)) {
dingRobotQueryWrapper.eq("jira_project_key", jiraProjectKey);
}
if (!StringUtils.isEmpty(projectName)) {
dingRobotQueryWrapper.like("project_name", projectName);
}
if (!StringUtils.isEmpty(namespace)) {
dingRobotQueryWrapper.eq("namespace", namespace);
}
dingRobotQueryWrapper.orderByDesc("id");
IPage<DingRobot> projectRobotIPage = dingRobotService.page(page, dingRobotQueryWrapper);
List<DingRobot> dingRobotList = projectRobotIPage.getRecords();
......
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