From bf2bd10d9e76b8b91f53546ed10f116318188cf8 Mon Sep 17 00:00:00 2001 From: HeeSung98 Date: Tue, 28 Nov 2023 10:24:50 +0900 Subject: [PATCH] test --- .../user/controller/UserController.java | 12 +++---- .../user/security/filter/ApiCheckFilter.java | 35 +++++++++---------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/user/src/main/java/com/weather/user/controller/UserController.java b/user/src/main/java/com/weather/user/controller/UserController.java index 163597f..eb2f039 100644 --- a/user/src/main/java/com/weather/user/controller/UserController.java +++ b/user/src/main/java/com/weather/user/controller/UserController.java @@ -25,7 +25,7 @@ public String googleLogin(){ return "redirect:/oauth2/authorization/google"; } - @PostMapping("/signup/email") + @PostMapping("/api/signup/email") public ResponseEntity verifyEmail(@RequestBody UserDTO userDTO) { log.info("userDTO: " + userDTO); @@ -37,7 +37,7 @@ public ResponseEntity verifyEmail(@RequestBody UserDTO userDTO) { return new ResponseEntity<>(result, HttpStatus.OK); } - @PostMapping("/signup/nickname") + @PostMapping("/api/signup/nickname") public ResponseEntity verifyNickname(@RequestBody UserDTO userDTO) { log.info("userDTO: " + userDTO); @@ -49,7 +49,7 @@ public ResponseEntity verifyNickname(@RequestBody UserDTO userDTO) { return new ResponseEntity<>(result, HttpStatus.OK); } - @PostMapping("/signup") + @PostMapping("/api/signup") public ResponseEntity signup(@RequestBody UserDTO userDTO) { log.info("userDTO: " + userDTO); @@ -62,7 +62,7 @@ public ResponseEntity signup(@RequestBody UserDTO userDTO) { } - @PostMapping("/profile") + @PostMapping("/api/profile") public ResponseEntity profile(@RequestBody UserDTO userDTO) { log.info("userDTO: " + userDTO); @@ -71,7 +71,7 @@ public ResponseEntity profile(@RequestBody UserDTO userDTO) { return new ResponseEntity<>(result, HttpStatus.OK); } - @PatchMapping("/profile/modify") + @PatchMapping("/api/profile/modify") public ResponseEntity modify(@RequestBody UserDTO userDTO) { log.info("userDTO: " + userDTO); @@ -80,7 +80,7 @@ public ResponseEntity modify(@RequestBody UserDTO userDTO) { return new ResponseEntity<>(result, HttpStatus.OK); } - @DeleteMapping("/profile/remove/{email}") + @DeleteMapping("/api/profile/remove/{email}") public ResponseEntity remove(@PathVariable String email) { log.info("email: " + email); diff --git a/user/src/main/java/com/weather/user/security/filter/ApiCheckFilter.java b/user/src/main/java/com/weather/user/security/filter/ApiCheckFilter.java index 92d6849..8674c9f 100644 --- a/user/src/main/java/com/weather/user/security/filter/ApiCheckFilter.java +++ b/user/src/main/java/com/weather/user/security/filter/ApiCheckFilter.java @@ -38,24 +38,23 @@ public void doFilterInternal(HttpServletRequest request, HttpServletResponse res log.info("ApiCheckFilter.............................................."); log.info("ApiCheckFilter.............................................."); - boolean checkHeader = checkAuthHeader(request); - - if(checkHeader) { - filterChain.doFilter(request, response); - } - else { - response.setStatus(HttpServletResponse.SC_FORBIDDEN); - response.setContentType("application/json;charset=utf-8"); - JSONObject json = new JSONObject(); - String message = "FAIL CHECK API TOKEN"; - json.put("code", "403"); - json.put("message", message); - - PrintWriter out = response.getWriter(); - out.print(json); - - } - return; +// boolean checkHeader = checkAuthHeader(request); +// +// if(checkHeader) { +// filterChain.doFilter(request, response); +// } +// else { +// response.setStatus(HttpServletResponse.SC_FORBIDDEN); +// response.setContentType("application/json;charset=utf-8"); +// JSONObject json = new JSONObject(); +// String message = "FAIL CHECK API TOKEN"; +// json.put("code", "403"); +// json.put("message", message); +// +// PrintWriter out = response.getWriter(); +// out.print(json); +// } +// return; } log.info("?");