Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ public ResponseEntity<ApiResponse<PostStatusResponse>> toggleRecruitmentStatus(
return ResponseEntity.ok(ApiResponse.onSuccess(response));
}

@Override
@GetMapping("/{postId}/recruitment-status")
public ResponseEntity<ApiResponse<PostStatusResponse>> getRecruitmentStatus(
@PathVariable Long postId) {
PostStatusResponse response = dashboardService.getRecruitmentStatus(postId);
return ResponseEntity.ok(ApiResponse.onSuccess(response));
}

@Override
@GetMapping("/{postId}/analytics/bar-chart")
public ResponseEntity<ApiResponse<BarChartResponse>> getBarChartData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,25 @@ ResponseEntity<ApiResponse<Page<RecentReviewResponse>>> getRecentReviews(
Pageable pageable
);

@Operation(
summary = "모집 상태 조회",
description = """
현재 게시글의 모집 상태 조회

**PostStatus (게시글 상태):**
- `ACTIVE`: 활성 (모집중)
- `COMPLETED`: 완료 (모집 완료)
"""
)
ResponseEntity<ApiResponse<PostStatusResponse>> getRecruitmentStatus(
@PathVariable @Schema(description = "게시글 ID") Long postId
);

@Operation(
summary = "모집 상태 변경",
description = """
모집중 <-> 모집 완료 상태 토글

**PostStatus (게시글 상태):**
- `ACTIVE`: 활성 (모집중)
- `COMPLETED`: 완료 (모집 완료)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ public PostStatusResponse toggleRecruitmentStatus(Long postId, Long userId) {
return PostStatusResponse.of(postId, newStatus);
}

public PostStatusResponse getRecruitmentStatus(Long postId) {
Post post = getPost(postId);
PostStatus postStatus = post.getStatus();

return PostStatusResponse.of(postId, postStatus);
}

// 분석 그래프
public BarChartResponse getBarChartData(Long userId, Long postId) {
validatePostOwnership(userId, postId);
Expand Down