refactor: remove unused parameters and improve formatting
This commit is contained in:
parent
1111c91407
commit
851cfe1bc8
5 changed files with 28 additions and 18 deletions
|
@ -31,7 +31,7 @@ public class LootBoxController {
|
|||
}
|
||||
|
||||
@PostMapping("/lootboxes/{id}")
|
||||
public ResponseEntity<Object> purchaseLootBox(@PathVariable Long id, @RequestHeader("Authorization") String token) {
|
||||
public ResponseEntity<Object> purchaseLootBox(@PathVariable Long id) {
|
||||
Optional<LootBoxEntity> optionalLootBox = lootBoxRepository.findById(id);
|
||||
if (optionalLootBox.isEmpty()) {
|
||||
return ResponseEntity.notFound().build();
|
||||
|
|
|
@ -18,8 +18,7 @@ public class CorsFilter implements Filter {
|
|||
private String frontendHost;
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
|
||||
|
||||
HttpServletResponse response = (HttpServletResponse) res;
|
||||
HttpServletRequest request = (HttpServletRequest) req;
|
||||
|
|
|
@ -8,7 +8,10 @@ import de.szut.casino.user.UserEntity;
|
|||
import de.szut.casino.user.UserService;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
|
@ -28,7 +31,7 @@ public class SlotController {
|
|||
}
|
||||
|
||||
@PostMapping("/slots/spin")
|
||||
public ResponseEntity<Object> spinSlots(@RequestBody @Valid BetDto betDto, @RequestHeader("Authorization") String token) {
|
||||
public ResponseEntity<Object> spinSlots(@RequestBody @Valid BetDto betDto) {
|
||||
Optional<UserEntity> optionalUser = userService.getCurrentUser();
|
||||
|
||||
if (optionalUser.isEmpty()) {
|
||||
|
|
Reference in a new issue