1313import javax .servlet .http .HttpSession ;
1414
1515import apijson .demo .server .common .StandardParser ;
16+ import apijson .demo .server .common .UtilConstants ;
1617import com .zhangls .apijson .utils .StringUtil ;
1718import lombok .extern .slf4j .Slf4j ;
1819import org .springframework .web .bind .annotation .*;
2829 * @author zhangls
2930 */
3031@ Slf4j
31- // @RestController
32+ @ RestController
3233public class Controller {
3334
3435 /**
3536 * 获取 查询
3637 */
37- // @PostMapping(UtilConstants.Request.GET)
38+ @ PostMapping (UtilConstants .Request .GET )
3839 public String get (@ RequestBody String request , HttpSession session ) {
3940 log .info ("【进入 {} 方法,请求JSON串为】:{}" , RequestMethod .getName (GET ), request );
4041
@@ -44,7 +45,7 @@ public String get(@RequestBody String request, HttpSession session) {
4445 /**
4546 * 计数 查询count(*)
4647 */
47- // @PostMapping(UtilConstants.Request.HEAD)
48+ @ PostMapping (UtilConstants .Request .HEAD )
4849 public String head (@ RequestBody String request , HttpSession session ) {
4950 log .info ("进入 {} 方法,请求JSON串为:{}" , RequestMethod .getName (HEAD ), request );
5051
@@ -54,7 +55,7 @@ public String head(@RequestBody String request, HttpSession session) {
5455 /**
5556 * 限制性GET,request和response都非明文,浏览器看不到,用于对安全性要求高的GET请求
5657 */
57- // @PostMapping(UtilConstants.Request.GETS)
58+ @ PostMapping (UtilConstants .Request .GETS )
5859 public String gets (@ RequestBody String request , HttpSession session ) {
5960 log .info ("进入 {} 方法,请求JSON串为:{}" , RequestMethod .getName (GETS ), request );
6061
@@ -64,7 +65,7 @@ public String gets(@RequestBody String request, HttpSession session) {
6465 /**
6566 * 限制性HEAD,request和response都非明文,浏览器看不到,用于对安全性要求高的HEAD请求
6667 */
67- // @PostMapping(UtilConstants.Request.HEADS)
68+ @ PostMapping (UtilConstants .Request .HEADS )
6869 public String heads (@ RequestBody String request , HttpSession session ) {
6970 log .info ("进入 {} 方法,请求JSON串为:{}" , RequestMethod .getName (HEADS ), request );
7071
@@ -74,7 +75,7 @@ public String heads(@RequestBody String request, HttpSession session) {
7475 /**
7576 * 新增POST
7677 */
77- // @PostMapping(UtilConstants.Request.POST)
78+ @ PostMapping (UtilConstants .Request .POST )
7879 public String post (@ RequestBody String request , HttpSession session ) {
7980 log .info ("进入 {} 方法,请求JSON串为:{}" , RequestMethod .getName (POST ), request );
8081
@@ -84,7 +85,7 @@ public String post(@RequestBody String request, HttpSession session) {
8485 /**
8586 * 修改 PUT
8687 */
87- // @PostMapping(UtilConstants.Request.PUT)
88+ @ PostMapping (UtilConstants .Request .PUT )
8889 public String put (@ RequestBody String request , HttpSession session ) {
8990 log .info ("进入 {} 方法,请求JSON串为:{}" , RequestMethod .getName (PUT ), request );
9091
@@ -94,7 +95,7 @@ public String put(@RequestBody String request, HttpSession session) {
9495 /**
9596 * 删除 DELETE
9697 */
97- // @PostMapping(UtilConstants.Request.DELETE)
98+ @ PostMapping (UtilConstants .Request .DELETE )
9899 public String delete (@ RequestBody String request , HttpSession session ) {
99100 log .info ("进入 {} 方法,请求JSON串为:{}" , RequestMethod .getName (DELETE ), request );
100101
@@ -106,7 +107,7 @@ public String delete(@RequestBody String request, HttpSession session) {
106107 * 只为兼容HTTP GET请求,推荐用HTTP POST,可删除
107108 */
108109 @ Deprecated
109- // @GetMapping("get/{request}")
110+ @ GetMapping ("get/{request}" )
110111 public String openGet (@ PathVariable String request , HttpSession session ) {
111112 try {
112113 request = URLDecoder .decode (request , StringUtil .UTF_8 );
@@ -121,7 +122,7 @@ public String openGet(@PathVariable String request, HttpSession session) {
121122 * 只为兼容HTTP GET请求,推荐用HTTP POST,可删除
122123 */
123124 @ Deprecated
124- // @GetMapping("head/{request}")
125+ @ GetMapping ("head/{request}" )
125126 public String openHead (@ PathVariable String request , HttpSession session ) {
126127 try {
127128 request = URLDecoder .decode (request , StringUtil .UTF_8 );
0 commit comments