diff --git a/src/main/java/app/controllers/other/ExternalVIPController.java b/src/main/java/app/controllers/other/ExternalVIPController.java index 0fa6bc2..0549342 100644 --- a/src/main/java/app/controllers/other/ExternalVIPController.java +++ b/src/main/java/app/controllers/other/ExternalVIPController.java @@ -14,14 +14,19 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.HashSet; + @RestController @RequestMapping("api/external/vip") public class ExternalVIPController { VIPService vipService; + HashSet unique_set; + @Autowired public ExternalVIPController(VIPService vipService) { this.vipService = vipService; + this.unique_set = new HashSet(); } @PostMapping @@ -30,7 +35,14 @@ public class ExternalVIPController { @RequestParam String steam, @RequestParam int amount, @RequestParam String service, - @RequestParam(required = false, defaultValue = "") String extra) { + @RequestParam(required = false, defaultValue = "") String extra, + @RequestParam(required = false, defaultValue = "") String unique) { + + if (!unique.isEmpty()) { + if (unique_set.contains(unique)) return new ResponseEntity(HttpStatus.NOT_ACCEPTABLE); + else unique_set.add(unique); + } + int result = vipService.addVIP( SteamIDConverter.getSteamID(steam), amount,