-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #971 from bounswe/main
Deployment of recent changes and developments 08.12.2023 21.13
- Loading branch information
Showing
80 changed files
with
34,633 additions
and
3,880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
app/backend/src/main/java/com/app/gamereview/controller/HomeController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.app.gamereview.controller; | ||
|
||
import com.app.gamereview.dto.request.home.HomePagePostsFilterRequestDto; | ||
import com.app.gamereview.model.Post; | ||
import com.app.gamereview.model.User; | ||
import com.app.gamereview.service.PostService; | ||
import com.app.gamereview.util.JwtUtil; | ||
import com.app.gamereview.util.validation.annotation.AuthorizationRequired; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import org.springdoc.core.annotations.ParameterObject; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.HttpHeaders; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/api/home") | ||
@Validated | ||
public class HomeController { | ||
|
||
private final PostService postService; | ||
|
||
@Autowired | ||
public HomeController(PostService postService) { | ||
this.postService = postService; | ||
} | ||
|
||
@GetMapping | ||
public ResponseEntity<List<Post>> getHomePagePosts(@ParameterObject HomePagePostsFilterRequestDto filter, | ||
@RequestHeader(name = HttpHeaders.AUTHORIZATION, | ||
required = false) String Authorization){ | ||
String email = null; | ||
if (JwtUtil.validateToken(Authorization)) | ||
email = JwtUtil.extractSubject(Authorization); | ||
List<Post> postsToShow = postService.getHomepagePosts(filter, email); | ||
return ResponseEntity.ok(postsToShow); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
app/backend/src/main/java/com/app/gamereview/dto/request/game/UpdateGameRequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.app.gamereview.dto.request.game; | ||
|
||
import jakarta.validation.constraints.NotEmpty; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.Date; | ||
|
||
@Getter | ||
@Setter | ||
public class UpdateGameRequestDto { | ||
@NotEmpty(message = "Game name cannot be null or empty") | ||
private String gameName; | ||
|
||
@NotEmpty(message = "Game description cannot be null or empty") | ||
private String gameDescription; | ||
|
||
@NotEmpty(message = "Game icon cannot be null or empty") | ||
private String gameIcon; | ||
|
||
@NotNull(message = "Release Date cannot be null or empty") | ||
private Date releaseDate; | ||
|
||
@NotEmpty(message = "Minimum system requirements cannot be null or empty") | ||
private String minSystemReq; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...kend/src/main/java/com/app/gamereview/dto/request/home/HomePagePostsFilterRequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.app.gamereview.dto.request.home; | ||
|
||
import com.app.gamereview.enums.SortDirection; | ||
import com.app.gamereview.enums.SortType; | ||
import com.app.gamereview.util.validation.annotation.ValidSortDirection; | ||
import com.app.gamereview.util.validation.annotation.ValidSortType; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class HomePagePostsFilterRequestDto { | ||
@ValidSortType(allowedValues = {SortType.OVERALL_VOTE, SortType.CREATION_DATE, SortType.VOTE_COUNT}) | ||
private String sortBy = SortType.CREATION_DATE.name(); | ||
|
||
@ValidSortDirection(allowedValues = {SortDirection.ASCENDING, SortDirection.DESCENDING}) | ||
private String sortDirection = SortDirection.DESCENDING.name(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.