Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

사용자가 저장한 이미지를 일정 별로 Read, Delete 하는 API 구현 #134

Merged
merged 11 commits into from
Aug 10, 2024
Merged
Prev Previous commit
Next Next commit
feat: 특정 일정의 모든 이미지를 불러오는 api 구현
yo0oni committed Aug 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit cd9d4a7385a7f3d3b23a9b22c2cd3ca5600666e0
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

import com.isp.backend.domain.scheduleImage.dto.request.SaveScheduleImageRequest;
import com.isp.backend.domain.scheduleImage.dto.response.SaveScheduleImageResponse;
import com.isp.backend.domain.scheduleImage.service.SaveImageService;
import com.isp.backend.domain.scheduleImage.service.SaveScheduleImageService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
@@ -13,12 +13,19 @@
@RequestMapping("/scheduleImages")
public class ScheduleImageController {

private final SaveImageService saveImageService;
private final SaveScheduleImageService saveScheduleImageService;
private final ReadScheduleImageService readScheduleImageService;

@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public SaveScheduleImageResponse create(@RequestPart(value = "image", required = false) MultipartFile image,
@RequestPart(value = "saveScheduleImageRequest") SaveScheduleImageRequest request) {
return saveImageService.save(request, image);
@RequestPart(value = "saveScheduleImageRequest") SaveScheduleImageRequest request) {
return saveScheduleImageService.save(request, image);
}

@GetMapping("/{scheduleId}")
@ResponseStatus(HttpStatus.CREATED)
public ReadScheduleImageResponse read(@PathVariable(name = "scheduleId") Long scheduleId) {
return readScheduleImageService.read(scheduleId);
}
}