-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
284 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
src/main/java/site/billbill/apiserver/common/enums/items/PriceStandard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package site.billbill.apiserver.common.enums.items; | ||
|
||
public enum PriceStandard { | ||
DAY, | ||
MONTH, | ||
YEAR | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/site/billbill/apiserver/model/post/ItemsBorrowJpaEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package site.billbill.apiserver.model.post; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.hibernate.annotations.DynamicUpdate; | ||
import site.billbill.apiserver.common.converter.BooleanConverter; | ||
import site.billbill.apiserver.common.converter.StringListConverter; | ||
import site.billbill.apiserver.common.enums.items.PriceStandard; | ||
import site.billbill.apiserver.common.enums.user.DeviceType; | ||
import site.billbill.apiserver.model.BaseTime; | ||
import site.billbill.apiserver.model.user.UserJpaEntity; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
@DynamicUpdate | ||
@Entity | ||
@Builder | ||
@Table(name = "items_borrow") | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ItemsBorrowJpaEntity extends BaseTime { | ||
@Id | ||
@Column(name = "item_id", nullable = false) | ||
private String id; | ||
@OneToOne | ||
@MapsId | ||
private ItemsJpaEntity items; | ||
@Enumerated(EnumType.STRING) | ||
@Column(name = "price_standard") | ||
private PriceStandard priceStandard; | ||
@Column(name = "price", nullable = false) | ||
private int price; | ||
@Column(name="deposit",nullable = false) | ||
private int deposit; | ||
@Column(name="start_date",nullable = false) | ||
private LocalDate startDate; | ||
@Column(name = "end_date", nullable = false) | ||
private LocalDate endDate; | ||
@Column(name ="borrow_satus_code") | ||
private String borrowStatusCode; | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/site/billbill/apiserver/model/post/ItemsCategoryJpaEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package site.billbill.apiserver.model.post; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.hibernate.annotations.DynamicUpdate; | ||
|
||
@DynamicUpdate | ||
@Entity | ||
@Builder | ||
@Table(name = "items_category") | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ItemsCategoryJpaEntity { | ||
|
||
@Id | ||
@Column(name ="category_id") | ||
private String id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="upper_cat_id",nullable = false) | ||
private ItemsCategoryJpaEntity upperCategory; | ||
|
||
@Column(name="name") | ||
private String name; | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/site/billbill/apiserver/model/post/ItemsExchangeJpaEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package site.billbill.apiserver.model.post; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.hibernate.annotations.DynamicUpdate; | ||
import site.billbill.apiserver.common.converter.StringListConverter; | ||
import site.billbill.apiserver.model.BaseTime; | ||
|
||
@DynamicUpdate | ||
@Entity | ||
@Builder | ||
@Table(name = "items_exchange") | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ItemsExchangeJpaEntity extends BaseTime { | ||
@Id | ||
@Column(name="item_id") | ||
private String item_id; | ||
|
||
@ManyToOne | ||
@MapsId | ||
private ItemsJpaEntity items; | ||
@Convert(converter = StringListConverter.class) | ||
@JoinColumn(name="wisiList",nullable = false) | ||
String wishList; | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/site/billbill/apiserver/model/post/ItemsJpaEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package site.billbill.apiserver.model.post; | ||
|
||
import io.micrometer.core.annotation.Counted; | ||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import site.billbill.apiserver.common.converter.BooleanConverter; | ||
import site.billbill.apiserver.common.converter.StringListConverter; | ||
import site.billbill.apiserver.model.BaseTime; | ||
import site.billbill.apiserver.model.user.UserJpaEntity; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Table(name = "items") | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ItemsJpaEntity extends BaseTime { | ||
@Id | ||
@Column(name = "item_id", nullable = false) | ||
private String id; | ||
@ManyToOne | ||
@JoinColumn(name="owner_id") | ||
private UserJpaEntity owner; | ||
@Convert(converter = StringListConverter.class) | ||
@Column(name = "images", nullable = true) | ||
private List<String> images; | ||
@Column(name = "title", nullable = false) | ||
private String title; | ||
@Column(name="content",nullable = false) | ||
private String content; | ||
@Column(name="like_count",nullable = false) | ||
private int viewCount; | ||
@Column(name = "del_yn", nullable = false) | ||
@Convert(converter = BooleanConverter.class) | ||
private boolean delYn; | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/site/billbill/apiserver/model/post/ItemsLocationJpaEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package site.billbill.apiserver.model.post; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.hibernate.annotations.DynamicUpdate; | ||
import site.billbill.apiserver.model.BaseTime; | ||
|
||
import java.awt.*; | ||
|
||
@DynamicUpdate | ||
@Entity | ||
@Builder | ||
@Table(name = "items_location") | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ItemsLocationJpaEntity extends BaseTime { | ||
@Id | ||
@Column(name="item_id") | ||
private String id; | ||
|
||
@MapsId | ||
@ManyToOne | ||
private ItemsJpaEntity items; | ||
|
||
@Column(name="address",nullable = false) | ||
private String address; | ||
|
||
@Column(name="coordinates",nullable = false) | ||
private Point coordinates; | ||
|
||
@Column(name = "latitude", nullable = true) | ||
private Double latitude; | ||
@Column(name = "longitude", nullable = true) | ||
private Double longitude; | ||
|
||
|
||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/site/billbill/apiserver/model/post/ItemsReviewJpaEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package site.billbill.apiserver.model.post; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.hibernate.annotations.DynamicUpdate; | ||
import site.billbill.apiserver.model.BaseTime; | ||
import site.billbill.apiserver.model.user.UserJpaEntity; | ||
|
||
@DynamicUpdate | ||
@Entity | ||
@Builder | ||
@Table(name = "items_review") | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ItemsReviewJpaEntity extends BaseTime { | ||
|
||
@Id | ||
@Column(name="review_id") | ||
private String id; | ||
@ManyToOne | ||
@JoinColumn(name="item_id") | ||
private ItemsJpaEntity items; | ||
@ManyToOne | ||
@JoinColumn(name="user_id") | ||
private UserJpaEntity user; | ||
|
||
@Column(name="rating",nullable = false) | ||
private int rating; | ||
@Column(name="content",nullable = false) | ||
private String content; | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/site/billbill/apiserver/model/post/emebeded/ItemsLikeId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package site.billbill.apiserver.model.post.emebeded; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
|
||
@Embeddable | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@EqualsAndHashCode | ||
@Data | ||
public class ItemsLikeId implements Serializable { | ||
@Column(name="item_id") | ||
private String itemId; | ||
@Column(name="user_id") | ||
private String userId; | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/site/billbill/apiserver/model/post/itemsLikeJpaEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package site.billbill.apiserver.model.post; | ||
|
||
import jakarta.mail.FetchProfile; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.hibernate.annotations.DynamicUpdate; | ||
import site.billbill.apiserver.common.converter.BooleanConverter; | ||
import site.billbill.apiserver.model.BaseTime; | ||
import site.billbill.apiserver.model.post.emebeded.ItemsLikeId; | ||
import site.billbill.apiserver.model.user.UserJpaEntity; | ||
|
||
@DynamicUpdate | ||
@Entity | ||
@Builder | ||
@Table(name = "items_like") | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
|
||
public class itemsLikeJpaEntity extends BaseTime { | ||
@EmbeddedId | ||
private ItemsLikeId id; | ||
|
||
@ManyToOne | ||
@MapsId | ||
@JoinColumn(name="item_id") | ||
private ItemsJpaEntity items; | ||
|
||
@ManyToOne | ||
@MapsId | ||
@JoinColumn(name="user_id") | ||
private UserJpaEntity user; | ||
|
||
@Column(name = "del_yn", nullable = false) | ||
@Convert(converter = BooleanConverter.class) | ||
private boolean delYn; | ||
|
||
} |