refactor: remove unused parameters and improve formatting
This commit is contained in:
parent
7f90e8cb94
commit
b3c4cb4c83
5 changed files with 28 additions and 18 deletions
|
@ -31,7 +31,7 @@ public class LootBoxController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/lootboxes/{id}")
|
@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);
|
Optional<LootBoxEntity> optionalLootBox = lootBoxRepository.findById(id);
|
||||||
if (optionalLootBox.isEmpty()) {
|
if (optionalLootBox.isEmpty()) {
|
||||||
return ResponseEntity.notFound().build();
|
return ResponseEntity.notFound().build();
|
||||||
|
|
|
@ -18,8 +18,7 @@ public class CorsFilter implements Filter {
|
||||||
private String frontendHost;
|
private String frontendHost;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
|
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
|
||||||
throws IOException, ServletException {
|
|
||||||
|
|
||||||
HttpServletResponse response = (HttpServletResponse) res;
|
HttpServletResponse response = (HttpServletResponse) res;
|
||||||
HttpServletRequest request = (HttpServletRequest) req;
|
HttpServletRequest request = (HttpServletRequest) req;
|
||||||
|
|
|
@ -8,7 +8,10 @@ import de.szut.casino.user.UserEntity;
|
||||||
import de.szut.casino.user.UserService;
|
import de.szut.casino.user.UserService;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import org.springframework.http.ResponseEntity;
|
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.math.BigDecimal;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -28,7 +31,7 @@ public class SlotController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/slots/spin")
|
@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();
|
Optional<UserEntity> optionalUser = userService.getCurrentUser();
|
||||||
|
|
||||||
if (optionalUser.isEmpty()) {
|
if (optionalUser.isEmpty()) {
|
||||||
|
|
|
@ -11,18 +11,24 @@
|
||||||
<p class="bonus-description">+ 200 Freispiele</p>
|
<p class="bonus-description">+ 200 Freispiele</p>
|
||||||
|
|
||||||
<div class="flex justify-center space-x-4 mt-6">
|
<div class="flex justify-center space-x-4 mt-6">
|
||||||
<a
|
@if (authService.isLoggedIn()) {
|
||||||
routerLink="/register"
|
<a routerLink="/home" class="w-full sm:w-auto button-primary px-6 sm:px-8 py-3 shadow-lg">
|
||||||
class="w-full sm:w-auto button-primary px-6 sm:px-8 py-3 shadow-lg"
|
Spiele
|
||||||
>
|
</a>
|
||||||
Konto erstellen
|
} @else {
|
||||||
</a>
|
<a
|
||||||
<a
|
routerLink="/register"
|
||||||
routerLink="/login"
|
class="w-full sm:w-auto button-primary px-6 sm:px-8 py-3 shadow-lg"
|
||||||
class="w-full sm:w-auto bg-slate-700 text-white hover:bg-slate-600 px-6 sm:px-8 py-3 shadow-lg rounded"
|
>
|
||||||
>
|
Konto erstellen
|
||||||
Anmelden
|
</a>
|
||||||
</a>
|
<a
|
||||||
|
routerLink="/login"
|
||||||
|
class="w-full sm:w-auto bg-slate-700 text-white hover:bg-slate-600 px-6 sm:px-8 py-3 shadow-lg rounded"
|
||||||
|
>
|
||||||
|
Anmelden
|
||||||
|
</a>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core';
|
import { ChangeDetectionStrategy, Component, inject, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { NgFor } from '@angular/common';
|
import { NgFor } from '@angular/common';
|
||||||
import { NavbarComponent } from '@shared/components/navbar/navbar.component';
|
import { NavbarComponent } from '@shared/components/navbar/navbar.component';
|
||||||
import { RouterLink } from '@angular/router';
|
import { RouterLink } from '@angular/router';
|
||||||
|
import { AuthService } from '@service/auth.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-landing-page',
|
selector: 'app-landing-page',
|
||||||
|
@ -13,6 +14,7 @@ import { RouterLink } from '@angular/router';
|
||||||
export class LandingComponent implements OnInit, OnDestroy {
|
export class LandingComponent implements OnInit, OnDestroy {
|
||||||
currentSlide = 0;
|
currentSlide = 0;
|
||||||
private autoplayInterval: ReturnType<typeof setInterval> | undefined;
|
private autoplayInterval: ReturnType<typeof setInterval> | undefined;
|
||||||
|
authService: AuthService = inject(AuthService);
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.startAutoplay();
|
this.startAutoplay();
|
||||||
|
|
Reference in a new issue