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) {