Skip to content

Commit

Permalink
fix(inventory): ERD 수정
Browse files Browse the repository at this point in the history
추가 ERD 수정을 반영하였다.
  • Loading branch information
GSB0203 committed Aug 13, 2024
1 parent 617dbda commit 5812edb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,16 @@ public class Inventory {
@JoinColumn(name = "item_id")
private Item item;

private int point;

private boolean isEquipped;

@Builder
public Inventory(Item item, int point) {
public Inventory(Item item) {
this.item = item;
this.point = point;
this.isEquipped = false;
}

public void update(Inventory inventory) {
this.item = inventory.getItem();
this.point = inventory.getPoint();
this.isEquipped = inventory.isEquipped();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
public record InventoryResponse(
Long id,
//User user,
Long itemId,
int point
Long itemId
) {
public static InventoryResponse from(Inventory inventory) {
return new InventoryResponse(
inventory.getId(),
inventory.getItem().getId(),
inventory.getPoint()
inventory.getItem().getId()
);
}
}

0 comments on commit 5812edb

Please sign in to comment.