Skip to content

Commit f8ea9c6

Browse files
authored
merge : 지원자 상세조회 오류해결
fix : 지원자 상세조회 오류해결
2 parents fe195f1 + c6c526f commit f8ea9c6

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/main/java/com/ilkan/domain/profile/api/UserWorkApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ ResponseEntity<Page<WorkApplyListResDto>> getApplicants(
146146
content = @Content(schema = @Schema(implementation = ApiErrorResponse.class)))
147147
})
148148
@AllowedRoles(Role.REQUESTER)
149-
@GetMapping("/{taskId}/applies/{applyId}")
149+
@GetMapping("/{taskId}/applies/{performerId}")
150150
ResponseEntity<WorkApplyDetailResDto> getWorkApplyDetail(
151151
@RequestHeader("X-Role") String role,
152152
@PathVariable Long taskId,
153-
@PathVariable Long applyId
153+
@PathVariable Long performerId
154154
);
155155

156156
@Operation(summary = "수행자 승인(배정)", description = "의뢰자가 특정 지원자를 승인하여 배정")

src/main/java/com/ilkan/domain/profile/controller/UserWorkController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ public ResponseEntity<Page<WorkApplyListResDto>> getApplicants(
139139

140140
// 의뢰자기준 수행자들이 지원한 지원서 상세 조회
141141
@AllowedRoles(Role.REQUESTER)
142-
@GetMapping("/{taskId}/applies/{applyId}")
142+
@GetMapping("/{taskId}/applies/{performerId}")
143143
public ResponseEntity<WorkApplyDetailResDto> getWorkApplyDetail(
144144
@RequestHeader("X-Role") String role,
145145
@PathVariable Long taskId,
146-
@PathVariable Long applyId
146+
@PathVariable Long performerId
147147
) {
148-
WorkApplyDetailResDto response = workService.getWorkApplyDetail(role, taskId, applyId);
148+
WorkApplyDetailResDto response = workService.getWorkApplyDetail(role, taskId, performerId);
149149
return ResponseEntity.ok(response);
150150
}
151151

src/main/java/com/ilkan/domain/work/repository/TaskApplicationRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface TaskApplicationRepository extends JpaRepository<TaskApplication
1515

1616
Optional<TaskApplication> findByTaskIdAndPerformerId(Work taskId, User performerId);
1717

18-
Optional<TaskApplication> findByIdAndTaskId_Id(Long applyId, Long taskId);
18+
Optional<TaskApplication> findByPerformerId_IdAndTaskId_Id(Long performerId, Long taskId);
1919

2020
boolean existsByTaskId_IdAndPerformerId_Id(Long taskId, Long performerId);
2121

src/main/java/com/ilkan/domain/work/service/WorkService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public Page<WorkApplyListResDto> getApplicantsByRequester(String roleHeader, Lon
304304
* 의뢰자 기준 수행자 지원 상세 조회
305305
* @param roleHeader 사용자 역할 헤더
306306
* @param workId 작업 ID
307-
* @param applyId 지원 ID
307+
* @param performerId 지원 ID
308308
* @return WorkApplyDetailResDto
309309
* @throws UserWorkExceptions.RequesterForbidden 권한이 없는 경우
310310
* @throws UserWorkExceptions.WorkNotFound 작업을 찾지 못한 경우
@@ -313,7 +313,7 @@ public Page<WorkApplyListResDto> getApplicantsByRequester(String roleHeader, Lon
313313
*/
314314
// 의뢰자기준 수행자들이 지원한 지원서 상세 조회
315315
@Transactional(readOnly = true)
316-
public WorkApplyDetailResDto getWorkApplyDetail(String roleHeader, Long workId, Long applyId) {
316+
public WorkApplyDetailResDto getWorkApplyDetail(String roleHeader, Long workId, Long performerId) {
317317
if (!"REQUESTER".equals(roleHeader)) {
318318
throw new UserWorkExceptions.RequesterForbidden();
319319
}
@@ -327,7 +327,7 @@ public WorkApplyDetailResDto getWorkApplyDetail(String roleHeader, Long workId,
327327
}
328328

329329
TaskApplication application = taskApplicationRepository
330-
.findByIdAndTaskId_Id(applyId, workId)
330+
.findByPerformerId_IdAndTaskId_Id(performerId, workId)
331331
.orElseThrow(UserWorkExceptions.NoAppliedWorks::new);
332332

333333
return WorkApplyDetailResDto.fromEntity(application);

0 commit comments

Comments
 (0)