2 changed files with 36 additions and 0 deletions
@ -0,0 +1,30 @@ |
|||||
|
package app.controllers.bot; |
||||
|
|
||||
|
import app.annotations.enums.AuthMethod; |
||||
|
import app.annotations.interfaces.CheckWebAccess; |
||||
|
import app.services.db.BanService; |
||||
|
import jakarta.servlet.http.HttpServletRequest; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.http.HttpStatus; |
||||
|
import org.springframework.http.ResponseEntity; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("api/bot/discord") |
||||
|
public class DiscordBanController { |
||||
|
BanService banService; |
||||
|
|
||||
|
@Autowired |
||||
|
public DiscordBanController(BanService banService) { |
||||
|
this.banService = banService; |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/banlist") |
||||
|
@CheckWebAccess(auth_method = AuthMethod.SECRET_KEY) |
||||
|
public ResponseEntity getDiscordIDsBanList( |
||||
|
HttpServletRequest request) { |
||||
|
return new ResponseEntity(banService.getUsersDiscordWithBanOnServers(), HttpStatus.OK); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue