diff --git a/src/main/java/com/swp/PodBookingSystem/dto/request/RoomType/RoomTypeCreationRequest.java b/src/main/java/com/swp/PodBookingSystem/dto/request/RoomType/RoomTypeCreationRequest.java index 9758919a..3fe87d24 100644 --- a/src/main/java/com/swp/PodBookingSystem/dto/request/RoomType/RoomTypeCreationRequest.java +++ b/src/main/java/com/swp/PodBookingSystem/dto/request/RoomType/RoomTypeCreationRequest.java @@ -14,4 +14,5 @@ public class RoomTypeCreationRequest { int quantity; int capacity; Integer buildingId; + String image; } diff --git a/src/main/java/com/swp/PodBookingSystem/entity/RoomType.java b/src/main/java/com/swp/PodBookingSystem/entity/RoomType.java index 6450d02c..4a958d3e 100644 --- a/src/main/java/com/swp/PodBookingSystem/entity/RoomType.java +++ b/src/main/java/com/swp/PodBookingSystem/entity/RoomType.java @@ -25,6 +25,7 @@ public class RoomType { int quantity; int capacity; @Column(nullable = true, length = 1000) + String image; @JsonIgnore diff --git a/src/main/java/com/swp/PodBookingSystem/service/RoomTypeService.java b/src/main/java/com/swp/PodBookingSystem/service/RoomTypeService.java index 352ebaef..9be56c8d 100644 --- a/src/main/java/com/swp/PodBookingSystem/service/RoomTypeService.java +++ b/src/main/java/com/swp/PodBookingSystem/service/RoomTypeService.java @@ -33,6 +33,7 @@ public class RoomTypeService { public RoomTypeResponse createRoomType(RoomTypeCreationRequest request) { Optional building = buildingRepository.findById(request.getBuildingId()); RoomType newRoomType = roomTypeMapper.toRoomType(request); + newRoomType.setImage(request.getImage()); newRoomType.setBuilding(building.orElse(null)); return roomTypeMapper.toRoomTypeResponse(roomTypeRepository.save(newRoomType)); }