Browse Source

так лучше

master
gsd 2 years ago
parent
commit
bd4b17268f
  1. 4
      src/main/java/app/controllers/other/ExternalVIPController.java
  2. 5
      src/main/java/app/services/db/VIPService.java

4
src/main/java/app/controllers/other/ExternalVIPController.java

@ -31,11 +31,11 @@ public class ExternalVIPController {
@RequestParam int amount, @RequestParam int amount,
@RequestParam String service, @RequestParam String service,
@RequestParam(required = false, defaultValue = "") String extra) { @RequestParam(required = false, defaultValue = "") String extra) {
vipService.addVIP( int result = vipService.addVIP(
SteamIDConverter.getSteamID(steam), SteamIDConverter.getSteamID(steam),
amount, amount,
VipGiveMethod.valueOf(service.toUpperCase()), VipGiveMethod.valueOf(service.toUpperCase()),
extra); extra);
return new ResponseEntity("append",HttpStatus.OK); return new ResponseEntity(result, HttpStatus.OK);
} }
} }

5
src/main/java/app/services/db/VIPService.java

@ -74,8 +74,8 @@ public class VIPService {
return permitionService.getPermition(steamID); return permitionService.getPermition(steamID);
} }
public void addVIP(SteamID steamID, int amount, VipGiveMethod vipGiveMethod, String extra) { public int addVIP(SteamID steamID, int amount, VipGiveMethod vipGiveMethod, String extra) {
int result = 0; int result = 1;
switch (vipGiveMethod){ switch (vipGiveMethod){
case FREE -> { case FREE -> {
permitionService.addFreeVIP(steamID, amount); permitionService.addFreeVIP(steamID, amount);
@ -99,6 +99,7 @@ public class VIPService {
} }
} }
serverService.executeRCONOnAllServers("sm_reloadadmins"); serverService.executeRCONOnAllServers("sm_reloadadmins");
return result;
} }
public void publishWebhook(SteamID steamID, int amount, String status, boolean free) { public void publishWebhook(SteamID steamID, int amount, String status, boolean free) {

Loading…
Cancel
Save