From 22843604aa56873b9872fcd11d7746f365909ed1 Mon Sep 17 00:00:00 2001 From: gsd Date: Sat, 4 Mar 2023 11:54:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B5=20=D0=BD=D1=83=20=D1=8F=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=B7=D0=BD=D0=B0=D1=8E=20=D1=87=D1=82=D0=BE=20=D0=B5?= =?UTF-8?q?=D0=BC=D1=83=20=D0=BD=D0=B5=20=D1=85=D0=B2=D0=B0=D1=82=D0=B0?= =?UTF-8?q?=D0=B5=D1=82=20=D0=BD=D0=B0=D0=B4=D0=BE=20=D0=B8=D1=81=D0=BA?= =?UTF-8?q?=D0=BB=D1=8E=D1=87=D0=B8=D1=82=D1=8C=20=D0=B2=D1=81=D1=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/controllers/user/DetailController.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/app/controllers/user/DetailController.java b/src/main/java/app/controllers/user/DetailController.java index 003c3e6..92d66fd 100644 --- a/src/main/java/app/controllers/user/DetailController.java +++ b/src/main/java/app/controllers/user/DetailController.java @@ -8,10 +8,9 @@ import jakarta.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; @RestController @RequestMapping("api/profile") @@ -36,4 +35,12 @@ public class DetailController { @RequestParam String any) { return new ResponseEntity<>(profileService.GetSteamIDFromAnyData(any), HttpStatus.OK); } + + @PostMapping("/steam") + @CheckWebAccess(auth_method = AuthMethod.SECRET_KEY) + public ResponseEntity GetSteamOnHashMap(HttpServletRequest request, + @RequestBody HashMap container) { + if (!container.containsKey("any")) return new ResponseEntity(HttpStatus.BAD_REQUEST); + return new ResponseEntity<>(profileService.GetSteamIDFromAnyData(container.get("any")), HttpStatus.OK); + } }