-
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 #166 from sharemindteam/feature/164-post-search
feat: 공개 상담 검색 기능 구현
- Loading branch information
Showing
14 changed files
with
260 additions
and
35 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
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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/example/sharemind/post/content/PostListSortType.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.example.sharemind.post.content; | ||
|
||
import com.example.sharemind.post.exception.PostErrorCode; | ||
import com.example.sharemind.post.exception.PostException; | ||
import java.util.Arrays; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum PostListSortType { | ||
|
||
LATEST("publishedAt"), | ||
DESC_TOTAL_COMMENT("totalComment"), | ||
DESC_TOTAL_LIKE("totalLike"); | ||
|
||
private final String sortColumn; | ||
|
||
PostListSortType(String sortColumn) { | ||
this.sortColumn = sortColumn; | ||
} | ||
|
||
public static PostListSortType getSortTypeByName(String name) { | ||
return Arrays.stream(PostListSortType.values()) | ||
.filter(sortType -> sortType.name().equalsIgnoreCase(name)) | ||
.findAny() | ||
.orElseThrow(() -> new PostException(PostErrorCode.POST_SORT_TYPE_NOT_FOUND, 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
14 changes: 11 additions & 3 deletions
14
src/main/java/com/example/sharemind/searchWord/application/SearchWordService.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 |
---|---|---|
@@ -1,22 +1,30 @@ | ||
package com.example.sharemind.searchWord.application; | ||
|
||
import com.example.sharemind.counselor.dto.response.CounselorGetListResponse; | ||
import com.example.sharemind.post.dto.response.PostGetListResponse; | ||
import com.example.sharemind.searchWord.dto.request.SearchWordDeleteRequest; | ||
import com.example.sharemind.searchWord.dto.request.SearchWordFindRequest; | ||
import com.example.sharemind.searchWord.dto.request.SearchWordCounselorFindRequest; | ||
|
||
import com.example.sharemind.searchWord.dto.request.SearchWordPostFindRequest; | ||
import java.util.List; | ||
|
||
public interface SearchWordService { | ||
|
||
List<CounselorGetListResponse> storeSearchWordAndGetCounselorsByCustomer(Long customerId, String sortType, | ||
SearchWordFindRequest searchWordFindRequest); | ||
SearchWordCounselorFindRequest searchWordCounselorFindRequest); | ||
|
||
List<CounselorGetListResponse> storeAllSearchWordAndGetCounselors(String sortType, | ||
SearchWordFindRequest searchWordFindRequest); | ||
SearchWordCounselorFindRequest searchWordCounselorFindRequest); | ||
|
||
List<String> getRecentSearchWordsByCustomer(Long customerId); | ||
|
||
void removeSearchWordByCustomer(Long customerId, SearchWordDeleteRequest searchWordDeleteRequest); | ||
|
||
void storeSearchWordInDB(String word); | ||
|
||
List<PostGetListResponse> storeAllSearchWordAndGetPosts(String sortType, | ||
SearchWordPostFindRequest searchWordPostFindRequest); | ||
|
||
List<PostGetListResponse> storeSearchWordAndGetPosts(Long customerId, String sortType, | ||
SearchWordPostFindRequest searchWordPostFindRequest); | ||
} |
Oops, something went wrong.