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") 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 ) { 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() { 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; + } } 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); + } }