Skip to content

Commit

Permalink
[Feat] Item 도메인 및 Dto 수정(#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjk4618 committed May 30, 2024
1 parent c56cd6b commit 0493cab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class Item extends BaseTimeEntity {
@ManyToOne(fetch = FetchType.LAZY)
private Member member;

private String imageUrl;

private String title;

private int price;
Expand All @@ -41,8 +43,9 @@ public class Item extends BaseTimeEntity {


@Builder //빌더패턴
private Item(Member member, String title, int price, boolean isReceived, String detailInfo, Location hopeTradeSpot) {
private Item(Member member, String imageUrl, String title, int price, boolean isReceived, String detailInfo, Location hopeTradeSpot) {
this.member = member;
this.imageUrl = imageUrl;
this.title = title;
this.price = price;
this.isReceived = isReceived;
Expand All @@ -51,9 +54,10 @@ private Item(Member member, String title, int price, boolean isReceived, String
}

//정적팩토리메서드(빌더패턴이용)
public static Item register(Member member, String title, int price, boolean isReceived, String detailInfo, Location hopeTradeSpot) {
public static Item register(Member member, String imageUrl, String title, int price, boolean isReceived, String detailInfo, Location hopeTradeSpot) {
return Item.builder()
.member(member)
.imageUrl(imageUrl)
.title(title)
.price(price)
.isReceived(isReceived)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import jakarta.validation.constraints.NotNull;
import org.sopt.carrotMarket.constant.Location;
import org.sopt.carrotMarket.domain.Member;
import org.springframework.web.multipart.MultipartFile;

public record RegisterItemDTO(

Expand All @@ -20,5 +21,7 @@ public record RegisterItemDTO(
String detailInfo,

@NotBlank
String hopeTradeSpot
String hopeTradeSpot,

MultipartFile image
) { }

0 comments on commit 0493cab

Please sign in to comment.