-
Notifications
You must be signed in to change notification settings - Fork 0
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 #78 from SWM-Flash/integration
Integration
- Loading branch information
Showing
17 changed files
with
231 additions
and
99 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
1 change: 1 addition & 0 deletions
1
src/main/java/com/first/flash/climbing/problem/application/dto/ProblemsResponseDto.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
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
28 changes: 28 additions & 0 deletions
28
src/main/java/com/first/flash/climbing/problem/infrastructure/paging/ProblemSortBy.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,28 @@ | ||
package com.first.flash.climbing.problem.infrastructure.paging; | ||
|
||
public enum ProblemSortBy { | ||
|
||
VIEWS("views"), | ||
DIFFICULTY("difficulty"), | ||
RECOMMEND("recommend"); | ||
|
||
private static final ProblemSortBy DEFAULT_SORT_BY = RECOMMEND; | ||
private final String value; | ||
|
||
ProblemSortBy(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public static ProblemSortBy from(final String value) { | ||
for (ProblemSortBy problemSortBy : ProblemSortBy.values()) { | ||
if (problemSortBy.value.equalsIgnoreCase(value)) { | ||
return problemSortBy; | ||
} | ||
} | ||
return DEFAULT_SORT_BY; | ||
} | ||
} |
28 changes: 0 additions & 28 deletions
28
src/main/java/com/first/flash/climbing/problem/infrastructure/paging/SortBy.java
This file was deleted.
Oops, something went wrong.
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
16 changes: 16 additions & 0 deletions
16
...main/java/com/first/flash/climbing/solution/application/dto/SolutionsPageResponseDto.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,16 @@ | ||
package com.first.flash.climbing.solution.application.dto; | ||
|
||
import com.first.flash.climbing.solution.infrastructure.dto.MySolutionDto; | ||
import com.first.flash.global.paging.Meta; | ||
import java.util.List; | ||
|
||
public record SolutionsPageResponseDto(List<MySolutionDto> solutions, Meta meta) { | ||
|
||
public static SolutionsPageResponseDto of( | ||
final List<MySolutionDto> solutions, final String nextCursor) { | ||
if (solutions.isEmpty()) { | ||
return new SolutionsPageResponseDto(List.of(), null); | ||
} | ||
return new SolutionsPageResponseDto(solutions, Meta.from(nextCursor)); | ||
} | ||
} |
Oops, something went wrong.