-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Room, City, AccommodationType 매핑
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/main/java/com/example/airbnb/business/domain/accommodation/AccommodationType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.example.airbnb.business.domain.accommodation; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum AccommodationType { | ||
|
||
HOUSE("개인 주택"), | ||
HOTEL("호텔"), | ||
GUEST_HOUSE("게스트 하우스"), | ||
PENSION("펜션"); | ||
|
||
private final String value; | ||
|
||
AccommodationType(String value) { | ||
this.value = value; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/example/airbnb/business/domain/accommodation/City.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.example.airbnb.business.domain.accommodation; | ||
|
||
import javax.persistence.*; | ||
|
||
@Entity | ||
public class City { | ||
|
||
@Id | ||
@Column(name = "city_id") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Integer cityId; | ||
|
||
private String nation; | ||
|
||
private String name; | ||
|
||
private String image; | ||
|
||
public City(String nation, String name, String image) { | ||
this.nation = nation; | ||
this.name = name; | ||
this.image = image; | ||
} | ||
|
||
protected City(){} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/example/airbnb/business/domain/accommodation/Room.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.example.airbnb.business.domain.accommodation; | ||
|
||
import lombok.Getter; | ||
|
||
import javax.persistence.Embeddable; | ||
|
||
@Getter | ||
@Embeddable | ||
public class Room { | ||
|
||
private int bedRooms; | ||
private int beds; | ||
private int bathRooms; | ||
|
||
public Room(int beds, int bathRooms, int bedRooms) { | ||
this.beds = beds; | ||
this.bathRooms = bathRooms; | ||
this.bedRooms = bedRooms; | ||
} | ||
|
||
public Room() { | ||
} | ||
} | ||
|