From 00f8fa6114068b11b5f4cfcc88bb17a061d98c56 Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 16 Apr 2024 03:10:46 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[ADD]=20=EC=B5=9C=EC=B4=88=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=20Dto=EC=97=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/GetApplicantInfoResponseDto.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/dto/response/GetApplicantInfoResponseDto.java b/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/dto/response/GetApplicantInfoResponseDto.java index 1046b8e3..8b69ae45 100644 --- a/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/dto/response/GetApplicantInfoResponseDto.java +++ b/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/dto/response/GetApplicantInfoResponseDto.java @@ -9,6 +9,8 @@ public record GetApplicantInfoResponseDto( String title, @Schema(description = "오픈카톡방 링크", example = "https://open.kakao.com/o/gLmqdijg") String link, + @Schema(description = "처음 접속 여부", example = "true") + boolean isFirstAccess, List recruitmentStatus, List roles ) { From eaa95562a6a9707af50754437f4c980352732f12 Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 16 Apr 2024 03:11:04 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[FEAT]=20=EC=B5=9C=EC=B4=88=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=20API=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/RecruitmentApplicantApi.java | 8 ++++++++ .../api/RecruitmentApplicantController.java | 14 +++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/api/RecruitmentApplicantApi.java b/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/api/RecruitmentApplicantApi.java index b7e5251a..cd18a004 100644 --- a/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/api/RecruitmentApplicantApi.java +++ b/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/api/RecruitmentApplicantApi.java @@ -36,6 +36,14 @@ ResponseEntity setLink(@PathVariable("id") Long postId, @Valid @RequestBod @Operation(summary = "신청 관리 정보 조회 API") ResponseEntity getApplyInfo(@PathVariable("id") Long postId, @AuthUser User user); + @ApiResponses( + value = { + @ApiResponse(responseCode = "200", description = "방문 처리 성"), + } + ) + @Operation(summary = "최초 접근 후 호출 API") + ResponseEntity processFirstAccess(@PathVariable("id") Long postId, @AuthUser User user); + @ApiResponses( value = { @ApiResponse(responseCode = "200", description = "신청자 승인 성공"), diff --git a/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/api/RecruitmentApplicantController.java b/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/api/RecruitmentApplicantController.java index 0581a5e3..507a7029 100644 --- a/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/api/RecruitmentApplicantController.java +++ b/src/main/java/synk/meeteam/domain/recruitment/recruitment_applicant/api/RecruitmentApplicantController.java @@ -26,6 +26,7 @@ import synk.meeteam.domain.recruitment.recruitment_role.entity.RecruitmentRole; import synk.meeteam.domain.recruitment.recruitment_role.service.RecruitmentRoleService; import synk.meeteam.domain.user.user.entity.User; +import synk.meeteam.domain.user.user.service.UserService; import synk.meeteam.security.AuthUser; @RestController @@ -39,6 +40,8 @@ public class RecruitmentApplicantController implements RecruitmentApplicantApi { private final RecruitmentPostService recruitmentPostService; private final RecruitmentRoleService recruitmentRoleService; + private final UserService userService; + @PutMapping("/{id}/link") @Override public ResponseEntity setLink(@PathVariable("id") Long postId, @@ -68,7 +71,16 @@ public ResponseEntity getApplyInfo(@PathVariable("i return ResponseEntity.ok() .body(new GetApplicantInfoResponseDto(recruitmentPost.getTitle(), recruitmentPost.getKakaoLink(), - roleStatusResponseDtos, roleDtos)); + user.isFirstApplicantAccess(),roleStatusResponseDtos, + roleDtos)); + } + + @PatchMapping("/{id}/access") + @Override + public ResponseEntity processFirstAccess(@PathVariable("id") Long postId, @AuthUser User user) { + userService.processFirstAccess(user); + + return ResponseEntity.ok().build(); } @PatchMapping("/{id}/approve") From 17ae8604c886a1bb0dd7891eee85816751c7a313 Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 16 Apr 2024 03:11:25 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[FEAT]=20=EC=B5=9C=EC=B4=88=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=20=EC=84=9C=EB=B9=84=EC=8A=A4=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../synk/meeteam/domain/user/user/service/UserService.java | 2 ++ .../meeteam/domain/user/user/service/UserServiceImpl.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/synk/meeteam/domain/user/user/service/UserService.java b/src/main/java/synk/meeteam/domain/user/user/service/UserService.java index b35fd9dc..bb3e3d65 100644 --- a/src/main/java/synk/meeteam/domain/user/user/service/UserService.java +++ b/src/main/java/synk/meeteam/domain/user/user/service/UserService.java @@ -13,4 +13,6 @@ public interface UserService { User findById(Long userId); User findByEncryptedId(String encryptedId); + + void processFirstAccess(User user); } diff --git a/src/main/java/synk/meeteam/domain/user/user/service/UserServiceImpl.java b/src/main/java/synk/meeteam/domain/user/user/service/UserServiceImpl.java index a162cdd9..e48f70f8 100644 --- a/src/main/java/synk/meeteam/domain/user/user/service/UserServiceImpl.java +++ b/src/main/java/synk/meeteam/domain/user/user/service/UserServiceImpl.java @@ -74,4 +74,10 @@ public User findByEncryptedId(String encryptedId) { } return userRepository.findByIdFetchRole(userId); } + + @Transactional + public void processFirstAccess(User user) { + user.processFirstAccess(); + userRepository.save(user); + } } From 4be97a9751f1291f12cca824029d4ea2d4275f85 Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 16 Apr 2024 03:11:58 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[FIX]=20=EB=94=94=ED=8F=B4=ED=8A=B8?= =?UTF-8?q?=EA=B0=92=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../synk/meeteam/domain/user/user/entity/User.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/synk/meeteam/domain/user/user/entity/User.java b/src/main/java/synk/meeteam/domain/user/user/entity/User.java index e80922ea..1157fb7a 100644 --- a/src/main/java/synk/meeteam/domain/user/user/entity/User.java +++ b/src/main/java/synk/meeteam/domain/user/user/entity/User.java @@ -156,11 +156,11 @@ public class User extends BaseTimeEntity { @ColumnDefault("0") private long scoreProfessionalism = 0; - @ColumnDefault("0") - private boolean isFirstProfileAccess = false; + @ColumnDefault("1") + private boolean isFirstProfileAccess = true; - @ColumnDefault("0") - private boolean isFirstApplicantAccess = false; + @ColumnDefault("1") + private boolean isFirstApplicantAccess = true; public User(String platformId) { this.platformId = platformId; @@ -253,4 +253,8 @@ public void updateNickname(String nickname) { public boolean isNotEqualNickname(String nickname) { return !this.nickname.equals(nickname); } + + public void processFirstAccess(){ + this.isFirstApplicantAccess = false; + } } From c6146787bb280cf36a795469a546da60cdf6b25e Mon Sep 17 00:00:00 2001 From: mikekks Date: Tue, 16 Apr 2024 03:15:22 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[FIX]=20=EB=B9=8C=EB=8D=94=EC=97=90=20cours?= =?UTF-8?q?e,=20professor=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recruitment/recruitment_post/entity/RecruitmentPost.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/synk/meeteam/domain/recruitment/recruitment_post/entity/RecruitmentPost.java b/src/main/java/synk/meeteam/domain/recruitment/recruitment_post/entity/RecruitmentPost.java index 296ec96c..7a842e23 100644 --- a/src/main/java/synk/meeteam/domain/recruitment/recruitment_post/entity/RecruitmentPost.java +++ b/src/main/java/synk/meeteam/domain/recruitment/recruitment_post/entity/RecruitmentPost.java @@ -125,7 +125,8 @@ public class RecruitmentPost extends BaseEntity { public RecruitmentPost(String title, String content, Scope scope, Category category, Field field, ProceedType proceedType, LocalDate proceedingStart, LocalDate proceedingEnd, LocalDate deadline, - long bookmarkCount, String kakaoLink, boolean isClosed, Meeteam meeteam) { + long bookmarkCount, String kakaoLink, boolean isClosed, Meeteam meeteam, + Course course, Professor professor) { this.title = title; this.content = content; this.scope = scope; @@ -139,6 +140,8 @@ public RecruitmentPost(String title, String content, Scope scope, Category categ this.kakaoLink = kakaoLink; this.isClosed = isClosed; this.meeteam = meeteam; + this.course = course; + this.professor = professor; } public double getResponseRate() {