Skip to content

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis0405 committed Jan 16, 2025
1 parent eaa8c60 commit 27eb734
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import com.example.toyTeam6Airbnb.reservation.persistence.ReservationEntity
import java.time.LocalDate

data class Reservation(
val reservationId: Long,
val reservationId: Long
) {
companion object {
fun fromEntity(entity: ReservationEntity): Reservation {
return Reservation(
reservationId = entity.id!!,
reservationId = entity.id!!
)
}
}
Expand All @@ -22,8 +22,8 @@ data class ReservationDetails(
val startDate: LocalDate,
val endDate: LocalDate,
val place: String,
val numberOfGuests: Int,
//val imageUrl: String,
val numberOfGuests: Int
// val imageUrl: String,
) {
companion object {
fun fromEntity(entity: ReservationEntity): ReservationDetails {
Expand All @@ -34,8 +34,8 @@ data class ReservationDetails(
startDate = entity.startDate,
endDate = entity.endDate,
place = entity.room.address.sido,
numberOfGuests = entity.numberOfGuests,
//imageUrl = entity.room.imageUrl
numberOfGuests = entity.numberOfGuests
// imageUrl = entity.room.imageUrl
)
}
}
Expand All @@ -45,17 +45,17 @@ data class ReservationDTO(
val reservationId: Long,
val place: String,
val startDate: LocalDate,
val endDate: LocalDate,
//val imageUrl: String,
val endDate: LocalDate
// val imageUrl: String,
) {
companion object {
fun fromEntity(entity: ReservationEntity): ReservationDTO {
return ReservationDTO(
reservationId = entity.id!!,
place = entity.room.address.sido,
startDate = entity.startDate,
endDate = entity.endDate,
//imageUrl = entity.room.imageUrl
endDate = entity.endDate
// imageUrl = entity.room.imageUrl
)
}
}
Expand Down
25 changes: 12 additions & 13 deletions src/main/kotlin/com/example/toyTeam6Airbnb/room/controller/Room.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ data class Room(
val type: RoomType,
val sido: String,
val price: Double,
val averageRating: Double,
//val imageUrl: String
val averageRating: Double
// val imageUrl: String
) {
companion object {
fun fromEntity(entity: RoomEntity): Room {
Expand All @@ -27,8 +27,8 @@ data class Room(
type = entity.type,
sido = entity.address.sido,
price = entity.price.perNight,
averageRating = averageRating,
//imageUrl = entity.images.firstOrNull()?.url ?: ""
averageRating = averageRating
// imageUrl = entity.images.firstOrNull()?.url ?: ""
)
}
}
Expand All @@ -48,8 +48,8 @@ data class RoomDetailsDTO(
val reviewCount: Int,
val isSuperHost: Boolean,
val createdAt: Instant,
val updatedAt: Instant,
//val imageUrl: String,
val updatedAt: Instant
// val imageUrl: String,
) {
companion object {
fun fromEntity(entity: RoomEntity): RoomDetailsDTO {
Expand All @@ -70,23 +70,22 @@ data class RoomDetailsDTO(
reviewCount = entity.reviews.size,
isSuperHost = entity.host.isSuperhost(),
createdAt = entity.createdAt,
updatedAt = entity.updatedAt,
//imageUrl = entity.images.firstOrNull()?.url ?: ""
updatedAt = entity.updatedAt
// imageUrl = entity.images.firstOrNull()?.url ?: ""
)
}
}
}

data class RoomShortDTO(
val roomId: Long,
//val imageUrl: String,
val roomId: Long
// val imageUrl: String,
) {
companion object {
fun fromEntity(entity: RoomEntity): RoomShortDTO {

return RoomShortDTO(
roomId = entity.id!!,
//imageUrl = entity.images.firstOrNull()?.url ?: ""
roomId = entity.id!!
// imageUrl = entity.images.firstOrNull()?.url ?: ""
)
}
}
Expand Down

0 comments on commit 27eb734

Please sign in to comment.