4
4
import org .slf4j .Logger ;
5
5
import org .slf4j .LoggerFactory ;
6
6
import org .springframework .beans .factory .annotation .Autowired ;
7
+ import org .springframework .web .bind .annotation .GetMapping ;
8
+ import org .springframework .web .bind .annotation .PostMapping ;
7
9
import org .springframework .web .bind .annotation .RequestBody ;
8
10
import org .springframework .web .bind .annotation .RequestMapping ;
9
- import org .springframework .web .bind .annotation .RequestMethod ;
10
11
import org .springframework .web .bind .annotation .RequestParam ;
11
12
import org .springframework .web .bind .annotation .ResponseBody ;
12
13
import org .springframework .web .bind .annotation .RestController ;
@@ -30,8 +31,7 @@ public class WechatController {
30
31
@ Autowired
31
32
private WxMpMessageRouter router ;
32
33
33
- @ RequestMapping (method = RequestMethod .GET ,
34
- produces = "text/plain;charset=utf-8" )
34
+ @ GetMapping (produces = "text/plain;charset=utf-8" )
35
35
public @ ResponseBody String authGet (
36
36
@ RequestParam (name = "signature" ,
37
37
required = false ) String signature ,
@@ -54,8 +54,7 @@ public class WechatController {
54
54
return "非法请求" ;
55
55
}
56
56
57
- @ RequestMapping (method = RequestMethod .POST ,
58
- produces = "application/xml; charset=UTF-8" )
57
+ @ PostMapping (produces = "application/xml; charset=UTF-8" )
59
58
public @ ResponseBody String post (@ RequestBody String requestBody ,
60
59
@ RequestParam ("signature" ) String signature ,
61
60
@ RequestParam ("timestamp" ) String timestamp ,
0 commit comments