Skip to content

Commit

Permalink
Merge pull request #211 from fourix4/refactor/manager
Browse files Browse the repository at this point in the history
�refactor : 스터디카페 수정 로직 변경
  • Loading branch information
TaeHoon0 authored Jul 28, 2024
2 parents edbcba8 + 4ef622d commit 1fcf37c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,12 @@ public Response saveStudyCafe(@RequestParam String cafeName, @RequestParam Addre
}

@PatchMapping("/manager")
public Response updateStudyCafe(@RequestParam("cafe_name") String cafeName,
@RequestPart("address") AddressRequestDto address,
@RequestParam("opening_hours") String openingHours,
@RequestParam("closed_hours") String closedHours,
@RequestParam("closed_day") String closedDay,
@RequestParam("cafe_phone") String cafePhone,
@RequestParam("seats") Integer seats,
@RequestPart("room_info") RoomInfoRequestDto roomInfo,
@RequestPart("usage_fee") List<UsageFeeRequestDto> usageFee,
@RequestParam("title_image") MultipartFile titleImage,
@RequestParam("multiple_images") List<MultipartFile> multipleImages,
@RequestParam("seat_chart_image") MultipartFile seatChartImage) {
public Response updateStudyCafe(@RequestPart(value = "data") ManagerRequestDto requestDto,
@RequestPart(value = "title_image", required = false) MultipartFile titleImage,
@RequestPart(value = "multiple_images", required = false) List<MultipartFile> multipleImages,
@RequestPart(value = "seat_chart_image", required = false) MultipartFile seatChartImage) {
ManagerRequestDto managerRequestDto = new ManagerRequestDto(
cafeName, address, openingHours, closedHours, closedDay, cafePhone, seats, roomInfo, usageFee, titleImage, multipleImages, seatChartImage);
requestDto, titleImage, multipleImages, seatChartImage);

System.out.println(managerRequestDto.getCafePhone());
System.out.println(managerRequestDto.getCafeName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,19 @@ public class ManagerRequestDto {
private MultipartFile titleImage;
private List<MultipartFile> multipleImages;
private MultipartFile seatChartImage;

public ManagerRequestDto(ManagerRequestDto requestDto, MultipartFile titleImage, List<MultipartFile> multipleImages,
MultipartFile seatChartImage) {
this.cafeName = requestDto.getCafeName();
this.address = requestDto.getAddress();
this.openingHours = requestDto.getOpeningHours();
this.closedDay = requestDto.getClosedDay();
this.cafePhone = requestDto.getCafePhone();
this.seats = requestDto.getSeats();
this.roomInfo = requestDto.getRoomInfo();
this.usageFee = requestDto.getUsageFee();
this.titleImage = titleImage;
this.multipleImages = multipleImages;
this.seatChartImage = seatChartImage;
}
}

0 comments on commit 1fcf37c

Please sign in to comment.