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 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);
}
}

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

Loading…
Cancel
Save