Commit c0647aac authored by 黎博's avatar 黎博

test

parent 99fbad3c
......@@ -5,9 +5,12 @@ import cn.qg.holmes.entity.jira.SendScheduleVo;
import cn.qg.holmes.service.jira.JiraIssueService;
import cn.qg.holmes.utils.DingdingUtils;
import com.atlassian.jira.rest.client.api.domain.Issue;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
@Slf4j
@CrossOrigin
@RestController
@RequestMapping("/jira")
......@@ -16,6 +19,9 @@ public class JiraController {
@Autowired
JiraIssueService jiraIssueService;
@Value("${task.debug}")
private String taskDebug;
@GetMapping("/report/project")
public void sendReportToDingdingGroup(String project, String webhook) throws Exception {
Iterable<Issue> issues = jiraIssueService.getUnsolvedIssueListByProject(project);
......@@ -35,4 +41,13 @@ public class JiraController {
String markdownMsg = DingdingUtils.buildTestScheduleMarkdownMsg(issues, sendScheduleVo.getProgress(), sendScheduleVo.getRisk());
return JsonResult.buildSuccessResult(DingdingUtils.sendToDingding(markdownMsg, sendScheduleVo.getWebhook()));
}
@GetMapping("/test")
public void test() {
if (taskDebug.equals("true")) {
log.info("true");
} else {
log.info("false");
}
}
}
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