Commit 508fcc7d authored by 黎博's avatar 黎博

jira webhook 测试

parent 68177122
package cn.qg.holmes.controller.jira;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
@RestController
@RequestMapping("/jira")
@Slf4j
public class JiraWebhookController {
@PostMapping("/webhook")
public Boolean jiraWebhook(HttpServletRequest request) {
log.info("已进入jira webhook!");
BufferedReader br = null;
String str, wholeStr = "";
try {
br = request.getReader();
while ((str = br.readLine()) != null) {
wholeStr += str;
}
log.info("jiraWebHook body: {}", wholeStr);
} catch (Exception e) {
log.error("jiraWebHook error", e);
} finally {
if (br != null) {
try {
br.close();
} catch (Exception e) {
}
}
}
return true;
}
}
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