-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/career-refactor
- Loading branch information
Showing
32 changed files
with
589 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,7 +156,26 @@ jobs: | |
with: | ||
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
content: | | ||
Server successfully updated to Commit[${{ steps.slug.outputs.sha7 }}] on branch ${{ github.ref_name }} | ||
Commit message: ${{ github.event.head_commit.message }} | ||
:o: Server successfully updated! | ||
Commit: [${{ github.sha }}] | ||
Branch: ${{ github.ref_name }} | ||
Commit Link: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | ||
GitHub Action Link: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
GitHub Action Link: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
failure_notification: | ||
name: Failure Notification | ||
runs-on: ubuntu-latest | ||
if: failure() | ||
|
||
steps: | ||
- name: Discord Webhook Action on Failure | ||
uses: tsickert/[email protected] | ||
with: | ||
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
content: | | ||
:x: A job failed in the CI/CD pipeline! | ||
Commit: [${{ github.sha }}] | ||
Branch: ${{ github.ref_name }} | ||
Commit Link: https://github.com/${{ github.repository }}/commit/${{ github.sha }} | ||
GitHub Action Link: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
Please check the logs for more details. |
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
41 changes: 41 additions & 0 deletions
41
src/main/java/umc/kkijuk/server/recruit/controller/RecruitSearchController.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,41 @@ | ||
package umc.kkijuk.server.recruit.controller; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
import umc.kkijuk.server.login.argumentresolver.Login; | ||
import umc.kkijuk.server.login.controller.dto.LoginInfo; | ||
import umc.kkijuk.server.member.domain.Member; | ||
import umc.kkijuk.server.member.service.MemberService; | ||
import umc.kkijuk.server.recruit.controller.port.RecruitSearchService; | ||
import umc.kkijuk.server.recruit.controller.response.RecruitReviewListByKeywordResponse; | ||
|
||
@Tag(name = "Search Recruit", description = "공고 검색 API") | ||
@Slf4j | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/recruit") | ||
public class RecruitSearchController { | ||
|
||
private final RecruitSearchService recruitSearchService; | ||
private final MemberService memberService; | ||
|
||
@Operation( | ||
summary = "공고 이름 & 태그 / 공고 후기 기준으로 검색", | ||
description = "입력받은 텍스트에 대하여, 공고 제목, 공고 태그, 혹은 공고 후기에 포함하는 모든 공고를 검색합니다. 정렬기준은 최신순입니다.") | ||
@GetMapping | ||
public ResponseEntity<RecruitReviewListByKeywordResponse> findRecruitsByKeyword( | ||
@Login LoginInfo loginInfo, | ||
@RequestParam String keyword) { | ||
|
||
Member requestMember = memberService.getById(loginInfo.getMemberId()); | ||
RecruitReviewListByKeywordResponse result = recruitSearchService.findRecruitByKeyword(requestMember, keyword); | ||
|
||
return ResponseEntity | ||
.ok() | ||
.body(result); | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
src/main/java/umc/kkijuk/server/recruit/controller/port/RecruitSearchService.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,9 @@ | ||
package umc.kkijuk.server.recruit.controller.port; | ||
|
||
import umc.kkijuk.server.member.domain.Member; | ||
import umc.kkijuk.server.recruit.controller.response.RecruitReviewListByKeywordResponse; | ||
|
||
public interface RecruitSearchService { | ||
|
||
public RecruitReviewListByKeywordResponse findRecruitByKeyword(Member requestMember, String keyword); | ||
} |
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
31 changes: 31 additions & 0 deletions
31
src/main/java/umc/kkijuk/server/recruit/controller/response/RecruitByKeyword.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,31 @@ | ||
package umc.kkijuk.server.recruit.controller.response; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import umc.kkijuk.server.recruit.domain.Recruit; | ||
import umc.kkijuk.server.recruit.domain.RecruitStatus; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
public class RecruitByKeyword { | ||
private final Long recruitId; | ||
private final String recruitTitle; | ||
private final List<String> tags; | ||
private final LocalDateTime startTime; | ||
private final LocalDateTime endTime; | ||
private final RecruitStatus status; | ||
|
||
public static RecruitByKeyword from(Recruit recruit) { | ||
return RecruitByKeyword.builder() | ||
.recruitId(recruit.getId()) | ||
.recruitTitle(recruit.getTitle()) | ||
.tags(recruit.getTags()) | ||
.startTime(recruit.getStartTime()) | ||
.endTime(recruit.getEndTime()) | ||
.status(recruit.getStatus()) | ||
.build(); | ||
} | ||
} |
2 changes: 0 additions & 2 deletions
2
src/main/java/umc/kkijuk/server/recruit/controller/response/RecruitCountByDay.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
45 changes: 45 additions & 0 deletions
45
...ava/umc/kkijuk/server/recruit/controller/response/RecruitReviewListByKeywordResponse.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,45 @@ | ||
package umc.kkijuk.server.recruit.controller.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import umc.kkijuk.server.recruit.domain.Recruit; | ||
import umc.kkijuk.server.review.domain.RecruitReviewDto; | ||
import umc.kkijuk.server.review.controller.response.ReviewByKeyword; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Getter | ||
@Builder | ||
public class RecruitReviewListByKeywordResponse { | ||
@Schema(description = "검색 키워드", example = "2024-07-19") | ||
private final String keyword; | ||
|
||
@Schema(description = "검색 키워드가 제목 또는 태그에 포함된 공고 목록") | ||
private final List<RecruitByKeyword> recruitResult; | ||
|
||
@Schema(description = "검색 키워드가 review에 포함된 공고 목록") | ||
private final List<ReviewByKeyword> reviewResult; | ||
|
||
public static RecruitReviewListByKeywordResponse from(String keyword, List<Recruit> recruits, List<RecruitReviewDto> reviews) { | ||
List<ReviewByKeyword> reviewResult = new ArrayList<>(); | ||
|
||
for (RecruitReviewDto recruitReviewDto : reviews) { | ||
ReviewByKeyword existingReview = reviewResult.stream() | ||
.filter(r -> r.getRecruitId().equals(recruitReviewDto.getRecruitId())) | ||
.findFirst() | ||
.orElse(null); | ||
|
||
if (existingReview == null) reviewResult.add(ReviewByKeyword.from(recruitReviewDto)); | ||
else existingReview.addReview(recruitReviewDto); | ||
} | ||
|
||
|
||
return RecruitReviewListByKeywordResponse.builder() | ||
.keyword(keyword) | ||
.recruitResult(recruits.stream().map(RecruitByKeyword::from).toList()) | ||
.reviewResult(reviewResult) | ||
.build(); | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
src/main/java/umc/kkijuk/server/recruit/controller/response/ValidRecruitList.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
33 changes: 33 additions & 0 deletions
33
src/main/java/umc/kkijuk/server/recruit/service/RecruitSearchServiceImpl.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,33 @@ | ||
package umc.kkijuk.server.recruit.service; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
import umc.kkijuk.server.member.domain.Member; | ||
import umc.kkijuk.server.recruit.controller.port.RecruitSearchService; | ||
import umc.kkijuk.server.recruit.controller.response.RecruitReviewListByKeywordResponse; | ||
import umc.kkijuk.server.recruit.domain.Recruit; | ||
import umc.kkijuk.server.review.domain.RecruitReviewDto; | ||
import umc.kkijuk.server.recruit.service.port.RecruitRepository; | ||
import umc.kkijuk.server.review.service.port.ReviewRepository; | ||
|
||
import java.util.List; | ||
|
||
@Slf4j | ||
@Service | ||
@RequiredArgsConstructor | ||
public class RecruitSearchServiceImpl implements RecruitSearchService { | ||
private final RecruitRepository recruitRepository; | ||
private final ReviewRepository reviewRepository; | ||
|
||
public RecruitReviewListByKeywordResponse findRecruitByKeyword(Member requestMember, String keyword) { | ||
List<Recruit> recruits = recruitRepository.searchRecruitByKeyword(requestMember.getId(), keyword); | ||
List<RecruitReviewDto> reviews = reviewRepository.findReviewByKeyword(requestMember.getId(), keyword); | ||
|
||
for (RecruitReviewDto review : reviews) { | ||
log.info("keyword: {}, result: {}", keyword, review.getReviewContent()); | ||
} | ||
|
||
return RecruitReviewListByKeywordResponse.from(keyword, recruits, reviews); | ||
} | ||
} |
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.