Skip to content

Commit 424a287

Browse files
authored
Merge pull request #19 from SOPT-all/feat/#12
[feat/#12] 컬럼추가
2 parents f0b11f1 + 9ddf346 commit 424a287

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

src/main/java/com/sopkathon/domain/place/dto/GetPlaceResponse.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public record GetPlaceResponse(
1111
String name,
1212
String description,
1313
String mapLink,
14+
int price,
15+
String farmer,
1416
String photoUrl
1517
) {
1618

@@ -21,6 +23,8 @@ public static GetPlaceResponse of(PlaceEntity placeEntity) {
2123
.description(placeEntity.getDescription())
2224
.mapLink(placeEntity.getMapLink())
2325
.photoUrl(placeEntity.getPhotoUrl())
26+
.price(placeEntity.getPrice())
27+
.farmer(placeEntity.getFarmer())
2428
.build();
2529
}
2630
}

src/main/java/com/sopkathon/domain/place/entity/PlaceEntity.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,35 @@ public class PlaceEntity {
5252
@JoinColumn(name = "subway_id", nullable = false)
5353
private SubwayEntity subwayEntity;
5454

55+
@Column(name = "price", nullable = true)
56+
private int price;
57+
58+
@Column(name = "farmer", nullable = false)
59+
private String farmer;
60+
61+
@Column(name = "date", nullable = false)
62+
private String date;
63+
64+
@Column(name = "location", nullable = false)
65+
private String location;
66+
67+
@Column(name = "started_at", nullable = false)
68+
private String startedAt;
69+
70+
@Column(name = "end_at", nullable = false)
71+
private String endAt;
5572

5673
@Builder
57-
public PlaceEntity(int duration, String description, String mapLink, String photoUrl, Category category,
58-
SubwayEntity subwayEntity) {
74+
public PlaceEntity(String name, int duration, String description, String mapLink, String photoUrl,
75+
Category category,
76+
SubwayEntity subwayEntity, int price) {
77+
this.name = name;
5978
this.duration = duration;
6079
this.description = description;
6180
this.mapLink = mapLink;
6281
this.photoUrl = photoUrl;
6382
this.category = category;
6483
this.subwayEntity = subwayEntity;
84+
this.price = price;
6585
}
6686
}

0 commit comments

Comments
 (0)