diff --git a/backend/src/main/java/com/isp/backend/domain/country/entity/Country.java b/backend/src/main/java/com/isp/backend/domain/country/entity/Country.java index 3b7321cf..1c713c82 100644 --- a/backend/src/main/java/com/isp/backend/domain/country/entity/Country.java +++ b/backend/src/main/java/com/isp/backend/domain/country/entity/Country.java @@ -35,7 +35,6 @@ public class Country { private String currencyCode ; - @OneToMany (mappedBy = "country") - private List schedules; + private String currencyName ; } diff --git a/backend/src/main/java/com/isp/backend/domain/scheduleImage/dto/SaveScheduleImageRequest.java b/backend/src/main/java/com/isp/backend/domain/scheduleImage/dto/SaveScheduleImageRequest.java index 64958f57..852acc87 100644 --- a/backend/src/main/java/com/isp/backend/domain/scheduleImage/dto/SaveScheduleImageRequest.java +++ b/backend/src/main/java/com/isp/backend/domain/scheduleImage/dto/SaveScheduleImageRequest.java @@ -13,7 +13,7 @@ public class SaveScheduleImageRequest { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime saveDate; - public Long scheduleId() { - return scheduleId; - } +// public Long scheduleId() { +// return scheduleId; +// } } \ No newline at end of file diff --git a/backend/src/main/java/com/isp/backend/domain/scheduleImage/dto/SaveScheduleImageResponse.java b/backend/src/main/java/com/isp/backend/domain/scheduleImage/dto/SaveScheduleImageResponse.java index 24261068..d6270049 100644 --- a/backend/src/main/java/com/isp/backend/domain/scheduleImage/dto/SaveScheduleImageResponse.java +++ b/backend/src/main/java/com/isp/backend/domain/scheduleImage/dto/SaveScheduleImageResponse.java @@ -4,10 +4,14 @@ import lombok.Getter; @Getter -public final class SaveScheduleImageResponse { - private final ScheduleImage scheduleImage; +public class SaveScheduleImageResponse { + private Long id; + private Long scheduleId; + private String path; public SaveScheduleImageResponse(ScheduleImage scheduleImage) { - this.scheduleImage = scheduleImage; + this.id = scheduleImage.getId(); + this.scheduleId = scheduleImage.getSchedule().getId(); + this.path = scheduleImage.getPath(); } -} \ No newline at end of file +} diff --git a/backend/src/main/java/com/isp/backend/domain/scheduleImage/repository/ScheduleImageS3Repository.java b/backend/src/main/java/com/isp/backend/domain/scheduleImage/repository/ScheduleImageS3Repository.java index d08d1126..991f460f 100644 --- a/backend/src/main/java/com/isp/backend/domain/scheduleImage/repository/ScheduleImageS3Repository.java +++ b/backend/src/main/java/com/isp/backend/domain/scheduleImage/repository/ScheduleImageS3Repository.java @@ -28,7 +28,7 @@ public ScheduleImageS3Repository(S3Template s3template, } public String save(SaveScheduleImageRequest request, MultipartFile image) { - String path = IMAGE + request.scheduleId() + SLASH + image.getOriginalFilename(); + String path = IMAGE + request.getScheduleId() + SLASH + image.getOriginalFilename(); S3Resource result = s3template.upload(bucketName, path, getInputStream(image)); return getUrl(result); } diff --git a/backend/src/main/java/com/isp/backend/domain/scheduleImage/service/ScheduleImageService.java b/backend/src/main/java/com/isp/backend/domain/scheduleImage/service/ScheduleImageService.java index 7bd129c0..989eef97 100644 --- a/backend/src/main/java/com/isp/backend/domain/scheduleImage/service/ScheduleImageService.java +++ b/backend/src/main/java/com/isp/backend/domain/scheduleImage/service/ScheduleImageService.java @@ -22,7 +22,7 @@ public class ScheduleImageService implements SaveImageService { @Override public SaveScheduleImageResponse save(SaveScheduleImageRequest request, MultipartFile image) { String imagePath = scheduleImageS3Repository.save(request, image); - Schedule schedule = scheduleRepository.findById(request.scheduleId()).orElseThrow(IllegalArgumentException::new); + Schedule schedule = scheduleRepository.findById(request.getScheduleId()).orElseThrow(IllegalArgumentException::new); ScheduleImage scheduleImage = new ScheduleImage(schedule, imagePath); scheduleImageRepository.save(scheduleImage);