File tree Expand file tree Collapse file tree 5 files changed +446
-0
lines changed Expand file tree Collapse file tree 5 files changed +446
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" >
4+ <modelVersion >4.0.0</modelVersion >
5+ <parent >
6+ <groupId >com.notebook</groupId >
7+ <artifactId >Springboot-Notebook</artifactId >
8+ <version >0.0.1-SNAPSHOT</version >
9+ </parent >
10+ <artifactId >springboot-webhook-weixin</artifactId >
11+ <version >0.0.1-SNAPSHOT</version >
12+ <name >springboot-webhook-weixin</name >
13+
14+ <dependencies >
15+
16+ <dependency >
17+ <groupId >org.testng</groupId >
18+ <artifactId >testng</artifactId >
19+ <version >7.1.0</version >
20+ <scope >test</scope >
21+ </dependency >
22+
23+ <dependency >
24+ <groupId >com.aventstack</groupId >
25+ <artifactId >extentreports</artifactId >
26+ <version >3.0.6</version >
27+ </dependency >
28+
29+ </dependencies >
30+
31+ <build >
32+ <plugins >
33+ <plugin >
34+ <groupId >org.springframework.boot</groupId >
35+ <artifactId >spring-boot-maven-plugin</artifactId >
36+ </plugin >
37+ </plugins >
38+ </build >
39+
40+ </project >
Original file line number Diff line number Diff line change 1+ import org .springframework .boot .SpringApplication ;
2+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
3+
4+ @ SpringBootApplication
5+ public class SpringbootWebhookApplication {
6+
7+ public static void main (String [] args ) {
8+ SpringApplication .run (SpringbootWebhookApplication .class , args );
9+ }
10+
11+ }
Original file line number Diff line number Diff line change 1+ package com .xiaofu .webhook .controller ;
2+
3+ import com .alibaba .fastjson .JSON ;
4+ import com .xiaofu .webhook .vo .GithubWebhookPullVo ;
5+ import lombok .extern .slf4j .Slf4j ;
6+ import org .springframework .web .bind .annotation .PostMapping ;
7+ import org .springframework .web .bind .annotation .RequestBody ;
8+ import org .springframework .web .bind .annotation .RequestMapping ;
9+ import org .springframework .web .bind .annotation .RestController ;
10+
11+ @ Slf4j
12+ @ RestController
13+ public class WebhookController {
14+
15+ @ PostMapping ("/webhook" )
16+ public String webhookGithub (@ RequestBody GithubWebhookPullVo webhook ) {
17+
18+ log .info (JSON .toJSONString (webhook ));
19+ //TODO 发送企业微信 post请求
20+ return JSON .toJSONString (webhook );
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments