Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/com/api/mov/domain/pass/entity/Pass.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class Pass extends BaseEntity {
@Column
private String purposeTag;

@Column
private String imageUrl; //패키지 대표 이미지 URL

@OneToMany(mappedBy = "pass", cascade = CascadeType.ALL, orphanRemoval = true)
@Builder.Default
private List<PassItem> passItems = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public void createPass(PassCreateReq passCreateReq, Long userId) {
.name(passCreateReq.getPassName())
.price(passCreateReq.getPassPrice())
.description(passCreateReq.getPassDescription())
.imageUrl(passCreateReq.getImageUrl())
.build();

for (Facility facility : facilityList){
Expand Down Expand Up @@ -133,7 +134,8 @@ public List<MyPassRes> getMyPassList(Long userId,String status) {
pass.getName(),
pass.getPrice(),
pass.getDescription(),
passItemInfoList
passItemInfoList,
pass.getImageUrl()
);
}).toList();
}
Expand Down Expand Up @@ -161,7 +163,8 @@ public List<HomePassInfoRes> getPasses(String passName, Integer minPrice, Intege
pass.getId(),
pass.getName(),
pass.getDescription(),
pass.getPrice()
pass.getPrice(),
pass.getImageUrl()
))
.toList();
}
Expand Down Expand Up @@ -217,7 +220,8 @@ public PassDetailRes getPassDetail(Long passId) {
pass.getName(),
pass.getDescription(),
pass.getPrice(),
passItemInfoList
passItemInfoList,
pass.getImageUrl()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public record HomePassInfoRes(
Long passId,
String passName,
String passDescription,
int passPrice
int passPrice,
String imageUrl
) {
}
3 changes: 2 additions & 1 deletion src/main/java/com/api/mov/domain/pass/web/dto/MyPassRes.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public record MyPassRes(
String passName,
int passPrice,
String passDescription,
List<PassItemInfoRes> passItem
List<PassItemInfoRes> passItem,
String imageUrl
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ public class PassCreateReq {

@NotBlank(message = "저장 타입을 선택해주세요. (CART or LOCKER)")
private String storageType;

private String imageUrl; // 패키지 이미지 URL (선택사항)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public record PassDetailRes(
String passName,
String passDescription,
int passPrice,
List<PassItemInfoRes> passItems
List<PassItemInfoRes> passItems,
String imageUrl
) {
}