Skip to content

Commit b487880

Browse files
committed
feat(volunteer-apply): 봉사 지원 철회 기능 API
1 parent fcb83a4 commit b487880

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/main/java/com/somemore/volunteerapply/controller/VolunteerApplyCommandApiController.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
import com.somemore.global.common.response.ApiResponse;
55
import com.somemore.volunteerapply.dto.VolunteerApplyCreateRequestDto;
66
import com.somemore.volunteerapply.usecase.ApplyVolunteerApplyUseCase;
7+
import com.somemore.volunteerapply.usecase.WithdrawVolunteerApplyUseCase;
78
import io.swagger.v3.oas.annotations.Operation;
89
import io.swagger.v3.oas.annotations.tags.Tag;
910
import jakarta.validation.Valid;
1011
import java.util.UUID;
1112
import lombok.RequiredArgsConstructor;
1213
import org.springframework.security.access.annotation.Secured;
14+
import org.springframework.web.bind.annotation.DeleteMapping;
15+
import org.springframework.web.bind.annotation.PathVariable;
1316
import org.springframework.web.bind.annotation.PostMapping;
1417
import org.springframework.web.bind.annotation.RequestBody;
1518
import org.springframework.web.bind.annotation.RequestMapping;
@@ -22,6 +25,7 @@
2225
public 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

Comments
 (0)