Skip to content

Commit ea292d9

Browse files
authored
Merge pull request #19 from lion4thon/feat/image
feat: 이미지 필드 추가로 인한 로직 변경
2 parents 8d46e6c + e3a0f00 commit ea292d9

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

src/main/java/com/api/mov/domain/pass/entity/Pass.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public class Pass extends BaseEntity {
3939
@Column
4040
private String purposeTag;
4141

42+
@Column
43+
private String imageUrl; //패키지 대표 이미지 URL
44+
4245
@OneToMany(mappedBy = "pass", cascade = CascadeType.ALL, orphanRemoval = true)
4346
@Builder.Default
4447
private List<PassItem> passItems = new ArrayList<>();

src/main/java/com/api/mov/domain/pass/service/PassServiceImpl.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public void createPass(PassCreateReq passCreateReq, Long userId) {
7979
.name(passCreateReq.getPassName())
8080
.price(passCreateReq.getPassPrice())
8181
.description(passCreateReq.getPassDescription())
82+
.imageUrl(passCreateReq.getImageUrl())
8283
.build();
8384

8485
for (Facility facility : facilityList){
@@ -133,7 +134,8 @@ public List<MyPassRes> getMyPassList(Long userId,String status) {
133134
pass.getName(),
134135
pass.getPrice(),
135136
pass.getDescription(),
136-
passItemInfoList
137+
passItemInfoList,
138+
pass.getImageUrl()
137139
);
138140
}).toList();
139141
}
@@ -161,7 +163,8 @@ public List<HomePassInfoRes> getPasses(String passName, Integer minPrice, Intege
161163
pass.getId(),
162164
pass.getName(),
163165
pass.getDescription(),
164-
pass.getPrice()
166+
pass.getPrice(),
167+
pass.getImageUrl()
165168
))
166169
.toList();
167170
}
@@ -217,7 +220,8 @@ public PassDetailRes getPassDetail(Long passId) {
217220
pass.getName(),
218221
pass.getDescription(),
219222
pass.getPrice(),
220-
passItemInfoList
223+
passItemInfoList,
224+
pass.getImageUrl()
221225
);
222226
}
223227

src/main/java/com/api/mov/domain/pass/web/dto/HomePassInfoRes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public record HomePassInfoRes(
66
Long passId,
77
String passName,
88
String passDescription,
9-
int passPrice
9+
int passPrice,
10+
String imageUrl
1011
) {
1112
}

src/main/java/com/api/mov/domain/pass/web/dto/MyPassRes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public record MyPassRes(
77
String passName,
88
int passPrice,
99
String passDescription,
10-
List<PassItemInfoRes> passItem
10+
List<PassItemInfoRes> passItem,
11+
String imageUrl
1112
) {
1213
}

src/main/java/com/api/mov/domain/pass/web/dto/PassCreateReq.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ public class PassCreateReq {
1616

1717
@NotBlank(message = "저장 타입을 선택해주세요. (CART or LOCKER)")
1818
private String storageType;
19+
20+
private String imageUrl; // 패키지 이미지 URL (선택사항)
1921
}

src/main/java/com/api/mov/domain/pass/web/dto/PassDetailRes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public record PassDetailRes(
77
String passName,
88
String passDescription,
99
int passPrice,
10-
List<PassItemInfoRes> passItems
10+
List<PassItemInfoRes> passItems,
11+
String imageUrl
1112
) {
1213
}

0 commit comments

Comments
 (0)