Browse Source

мда пельмень

master
gsd 2 years ago
parent
commit
a4894bc8df
  1. 3
      src/main/java/app/controllers/admin/BanController.java
  2. 2
      src/main/java/app/controllers/admin/KickController.java
  3. 2
      src/main/java/app/controllers/admin/RconController.java
  4. 1
      src/main/java/app/controllers/user/ProfileController.java
  5. 2
      src/main/java/app/exceptions/handler/GlobalExceptionAdvice.java

3
src/main/java/app/controllers/admin/BanController.java

@ -4,6 +4,7 @@ import app.annotations.enums.AuthMethod;
import app.annotations.interfaces.BurstUpdatePlayers; import app.annotations.interfaces.BurstUpdatePlayers;
import app.annotations.interfaces.CheckPermitionFlag; import app.annotations.interfaces.CheckPermitionFlag;
import app.annotations.interfaces.CheckWebAccess; import app.annotations.interfaces.CheckWebAccess;
import app.annotations.interfaces.WaitAfterNext;
import app.entities.db.Ban; import app.entities.db.Ban;
import app.services.ProfileService; import app.services.ProfileService;
import app.services.db.BanService; import app.services.db.BanService;
@ -37,6 +38,7 @@ public class BanController {
@CheckWebAccess @CheckWebAccess
@CheckPermitionFlag(flag = "d") @CheckPermitionFlag(flag = "d")
@BurstUpdatePlayers @BurstUpdatePlayers
@WaitAfterNext
public ResponseEntity banPlayer( public ResponseEntity banPlayer(
HttpServletRequest request, HttpServletRequest request,
@CookieValue(value = "steam64") String admin_steam64, @CookieValue(value = "steam64") String admin_steam64,
@ -55,6 +57,7 @@ public class BanController {
@DeleteMapping @DeleteMapping
@CheckWebAccess @CheckWebAccess
@CheckPermitionFlag(flag = "e") @CheckPermitionFlag(flag = "e")
@WaitAfterNext
public ResponseEntity unbanPlayer( public ResponseEntity unbanPlayer(
HttpServletRequest request, HttpServletRequest request,
@CookieValue(value = "steam64") String admin_steam64, @CookieValue(value = "steam64") String admin_steam64,

2
src/main/java/app/controllers/admin/KickController.java

@ -3,6 +3,7 @@ package app.controllers.admin;
import app.annotations.interfaces.BurstUpdatePlayers; import app.annotations.interfaces.BurstUpdatePlayers;
import app.annotations.interfaces.CheckPermitionFlag; import app.annotations.interfaces.CheckPermitionFlag;
import app.annotations.interfaces.CheckWebAccess; import app.annotations.interfaces.CheckWebAccess;
import app.annotations.interfaces.WaitAfterNext;
import app.entities.PlayerProfile; import app.entities.PlayerProfile;
import app.services.ProfileService; import app.services.ProfileService;
import app.services.ServerService; import app.services.ServerService;
@ -36,6 +37,7 @@ public class KickController {
@CheckWebAccess @CheckWebAccess
@CheckPermitionFlag(flag = "c") @CheckPermitionFlag(flag = "c")
@BurstUpdatePlayers @BurstUpdatePlayers
@WaitAfterNext
public ResponseEntity kickPlayer( public ResponseEntity kickPlayer(
HttpServletRequest request, HttpServletRequest request,
@CookieValue(value = "steam64") String steam64, @CookieValue(value = "steam64") String steam64,

2
src/main/java/app/controllers/admin/RconController.java

@ -2,6 +2,7 @@ package app.controllers.admin;
import app.annotations.interfaces.CheckPermitionFlag; import app.annotations.interfaces.CheckPermitionFlag;
import app.annotations.interfaces.CheckWebAccess; import app.annotations.interfaces.CheckWebAccess;
import app.annotations.interfaces.WaitAfterNext;
import app.services.StatsService; import app.services.StatsService;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -23,6 +24,7 @@ public class RconController {
@PostMapping @PostMapping
@CheckWebAccess @CheckWebAccess
@CheckPermitionFlag(flag = "m") @CheckPermitionFlag(flag = "m")
@WaitAfterNext
public ResponseEntity<String> rcon(HttpServletRequest request, public ResponseEntity<String> rcon(HttpServletRequest request,
@RequestParam String srv, @RequestParam String srv,
@RequestParam String command) { @RequestParam String command) {

1
src/main/java/app/controllers/user/ProfileController.java

@ -40,6 +40,7 @@ public class ProfileController {
@GetMapping @GetMapping
@CheckWebAccess @CheckWebAccess
@BurstUpdatePlayers @BurstUpdatePlayers
@WaitAfterNext
public ResponseEntity GetCurrentUser(HttpServletRequest request, public ResponseEntity GetCurrentUser(HttpServletRequest request,
@CookieValue(value = "steam64", defaultValue = "") String steam64, @CookieValue(value = "steam64", defaultValue = "") String steam64,
@RequestParam(value = "requests", defaultValue = "") String requests @RequestParam(value = "requests", defaultValue = "") String requests

2
src/main/java/app/exceptions/handler/GlobalExceptionAdvice.java

@ -42,6 +42,6 @@ public class GlobalExceptionAdvice {
@ExceptionHandler(WaitRateLimit.class) @ExceptionHandler(WaitRateLimit.class)
public ResponseEntity handWaitRateLimit(){ public ResponseEntity handWaitRateLimit(){
return new ResponseEntity<>("wait current before call this", HttpStatus.FORBIDDEN); return new ResponseEntity<>("wait current before call this", HttpStatus.TOO_MANY_REQUESTS);
} }
} }

Loading…
Cancel
Save