44import com .somemore .global .common .response .ApiResponse ;
55import com .somemore .volunteerapply .dto .VolunteerApplyCreateRequestDto ;
66import com .somemore .volunteerapply .usecase .ApplyVolunteerApplyUseCase ;
7+ import com .somemore .volunteerapply .usecase .WithdrawVolunteerApplyUseCase ;
78import io .swagger .v3 .oas .annotations .Operation ;
89import io .swagger .v3 .oas .annotations .tags .Tag ;
910import jakarta .validation .Valid ;
1011import java .util .UUID ;
1112import lombok .RequiredArgsConstructor ;
1213import org .springframework .security .access .annotation .Secured ;
14+ import org .springframework .web .bind .annotation .DeleteMapping ;
15+ import org .springframework .web .bind .annotation .PathVariable ;
1316import org .springframework .web .bind .annotation .PostMapping ;
1417import org .springframework .web .bind .annotation .RequestBody ;
1518import org .springframework .web .bind .annotation .RequestMapping ;
2225public class VolunteerApplyCommandApiController {
2326
2427 private final ApplyVolunteerApplyUseCase applyVolunteerApplyUseCase ;
28+ private final WithdrawVolunteerApplyUseCase withdrawVolunteerApplyUseCase ;
2529
2630 @ Secured ("ROLE_VOLUNTEER" )
2731 @ Operation (summary = "봉사 활동 지원" , description = "봉사 활동에 지원합니다." )
@@ -37,4 +41,15 @@ public ApiResponse<Long> apply(
3741 );
3842 }
3943
44+ @ Secured ("ROLE_VOLUNTEER" )
45+ @ Operation (summary = "봉사 활동 지원 철회" , description = "봉사 활동 지원을 철회합니다." )
46+ @ DeleteMapping ("/volunteer-apply/{id}" )
47+ public ApiResponse <String > withdraw (
48+ @ CurrentUser UUID volunteerId ,
49+ @ PathVariable Long id
50+ ) {
51+ withdrawVolunteerApplyUseCase .withdraw (id , volunteerId );
52+ return ApiResponse .ok ("봉사 활동 지원 철회 성공" );
53+ }
54+
4055}
0 commit comments