From bd4b17268fdf03b82b50ad87ee5a7424c9513eda Mon Sep 17 00:00:00 2001 From: gsd Date: Wed, 15 Mar 2023 19:45:21 +0300 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B0=D0=BA=20=D0=BB=D1=83=D1=87=D1=88?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/app/controllers/other/ExternalVIPController.java | 4 ++-- src/main/java/app/services/db/VIPService.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/app/controllers/other/ExternalVIPController.java b/src/main/java/app/controllers/other/ExternalVIPController.java index 1e85fc2..0fa6bc2 100644 --- a/src/main/java/app/controllers/other/ExternalVIPController.java +++ b/src/main/java/app/controllers/other/ExternalVIPController.java @@ -31,11 +31,11 @@ public class ExternalVIPController { @RequestParam int amount, @RequestParam String service, @RequestParam(required = false, defaultValue = "") String extra) { - vipService.addVIP( + int result = vipService.addVIP( SteamIDConverter.getSteamID(steam), amount, VipGiveMethod.valueOf(service.toUpperCase()), extra); - return new ResponseEntity("append",HttpStatus.OK); + return new ResponseEntity(result, HttpStatus.OK); } } diff --git a/src/main/java/app/services/db/VIPService.java b/src/main/java/app/services/db/VIPService.java index ef19516..47efae1 100644 --- a/src/main/java/app/services/db/VIPService.java +++ b/src/main/java/app/services/db/VIPService.java @@ -74,8 +74,8 @@ public class VIPService { return permitionService.getPermition(steamID); } - public void addVIP(SteamID steamID, int amount, VipGiveMethod vipGiveMethod, String extra) { - int result = 0; + public int addVIP(SteamID steamID, int amount, VipGiveMethod vipGiveMethod, String extra) { + int result = 1; switch (vipGiveMethod){ case FREE -> { permitionService.addFreeVIP(steamID, amount); @@ -99,6 +99,7 @@ public class VIPService { } } serverService.executeRCONOnAllServers("sm_reloadadmins"); + return result; } public void publishWebhook(SteamID steamID, int amount, String status, boolean free) {