-
Notifications
You must be signed in to change notification settings - Fork 3
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
38 changed files
with
917 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/main/java/org/kakaoshare/backend/domain/base/entity/BaseTimeEntity.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,23 @@ | ||
package org.kakaoshare.backend.domain.base.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.EntityListeners; | ||
import jakarta.persistence.MappedSuperclass; | ||
import java.time.LocalDateTime; | ||
import lombok.Getter; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
@Getter | ||
@MappedSuperclass | ||
@EntityListeners(AuditingEntityListener.class) | ||
public abstract class BaseTimeEntity { | ||
|
||
@CreatedDate | ||
@Column(updatable = false) | ||
protected LocalDateTime createdAt; | ||
|
||
@LastModifiedDate | ||
protected LocalDateTime updatedAt; | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/org/kakaoshare/backend/domain/brand/entity/Brand.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,41 @@ | ||
package org.kakaoshare.backend.domain.brand.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.OneToMany; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import org.kakaoshare.backend.domain.base.entity.BaseTimeEntity; | ||
import org.kakaoshare.backend.domain.category.entity.Category; | ||
import org.kakaoshare.backend.domain.product.entity.Product; | ||
|
||
|
||
@Entity | ||
@Getter | ||
public class Brand extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long brandId; | ||
|
||
@Column(nullable = false) | ||
private String name; | ||
|
||
@Column | ||
private String iconPhoto; | ||
|
||
@Column(nullable = false) | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "category_id") | ||
private Category category; | ||
|
||
@OneToMany(mappedBy = "brand") | ||
private List<Product> products; | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/org/kakaoshare/backend/domain/brand/repository/BrandRepository.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,8 @@ | ||
package org.kakaoshare.backend.domain.brand.repository; | ||
|
||
import org.kakaoshare.backend.domain.brand.entity.Brand; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
|
||
public interface BrandRepository extends JpaRepository<Brand, Long> { | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/org/kakaoshare/backend/domain/category/entity/Category.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,35 @@ | ||
package org.kakaoshare.backend.domain.category.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.OneToMany; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import org.kakaoshare.backend.domain.base.entity.BaseTimeEntity; | ||
|
||
|
||
@Entity | ||
@Getter | ||
public class Category extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long categoryId; | ||
|
||
@Column(nullable = false) | ||
private String name; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "parent_id") | ||
private Category parent; | ||
|
||
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY) | ||
private List<Category> Categories; | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/org/kakaoshare/backend/domain/category/repository/CategoryRepository.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,8 @@ | ||
package org.kakaoshare.backend.domain.category.repository; | ||
|
||
import org.kakaoshare.backend.domain.category.entity.Category; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
|
||
public interface CategoryRepository extends JpaRepository<Category, Long> { | ||
} |
52 changes: 52 additions & 0 deletions
52
src/main/java/org/kakaoshare/backend/domain/funding/entity/Funding.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,52 @@ | ||
package org.kakaoshare.backend.domain.funding.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.OneToMany; | ||
import java.math.BigDecimal; | ||
import java.time.LocalDate; | ||
import java.time.OffsetDateTime; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import org.kakaoshare.backend.domain.base.entity.BaseTimeEntity; | ||
import org.kakaoshare.backend.domain.member.entity.Member; | ||
import org.kakaoshare.backend.domain.product.entity.Product; | ||
|
||
|
||
@Entity | ||
@Getter | ||
public class Funding extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long fundingId; | ||
|
||
@Column | ||
private String status; | ||
|
||
@Column(nullable = false) | ||
private LocalDate expiredAt; | ||
|
||
@Column(nullable = false, precision = 12, scale = 2) | ||
private BigDecimal goalAmount; | ||
|
||
@Column(nullable = false, precision = 12, scale = 2) | ||
private BigDecimal accumulateAmount; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "member_id", nullable = false) | ||
private Member member; | ||
|
||
@OneToMany(mappedBy = "funding") | ||
private List<FundingDetail> fundingDetails; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "product_id", nullable = false) | ||
private Product product; | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/org/kakaoshare/backend/domain/funding/entity/FundingDetail.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,41 @@ | ||
package org.kakaoshare.backend.domain.funding.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.OneToMany; | ||
import java.math.BigDecimal; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import org.kakaoshare.backend.domain.base.entity.BaseTimeEntity; | ||
import org.kakaoshare.backend.domain.order.entity.Order; | ||
|
||
|
||
@Entity | ||
@Getter | ||
public class FundingDetail extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long fundingDetailId; | ||
|
||
@Column(nullable = false, precision = 12, scale = 2) | ||
private BigDecimal amount; | ||
|
||
@Column(nullable = false, precision = 7, scale = 2) | ||
private BigDecimal rate; | ||
|
||
@OneToMany(mappedBy = "fundingDetail") | ||
private List<Order> orders; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "funding_id", nullable = false) | ||
private Funding funding; | ||
|
||
|
||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/org/kakaoshare/backend/domain/funding/repository/FundingDetailRepository.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,8 @@ | ||
package org.kakaoshare.backend.domain.funding.repository; | ||
|
||
import org.kakaoshare.backend.domain.funding.entity.FundingDetail; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
|
||
public interface FundingDetailRepository extends JpaRepository<FundingDetail, Long> { | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/org/kakaoshare/backend/domain/funding/repository/FundingRepository.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,8 @@ | ||
package org.kakaoshare.backend.domain.funding.repository; | ||
|
||
import org.kakaoshare.backend.domain.funding.entity.Funding; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
|
||
public interface FundingRepository extends JpaRepository<Funding, Long> { | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/org/kakaoshare/backend/domain/gift/entity/Gift.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 org.kakaoshare.backend.domain.gift.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import lombok.Getter; | ||
import org.kakaoshare.backend.domain.base.entity.BaseTimeEntity; | ||
import org.kakaoshare.backend.domain.order.entity.Order; | ||
import org.kakaoshare.backend.domain.product.entity.Product; | ||
|
||
|
||
@Entity | ||
@Getter | ||
public class Gift extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long giftId; | ||
@Column(nullable = false, length = 50) | ||
private String status; | ||
|
||
@Column | ||
private String message; | ||
|
||
@Column | ||
private String messagePhoto; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "orders_id", nullable = false) | ||
private Order order; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "product_id", nullable = false) | ||
private Product product; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/org/kakaoshare/backend/domain/gift/repository/GiftRepository.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,8 @@ | ||
package org.kakaoshare.backend.domain.gift.repository; | ||
|
||
import org.kakaoshare.backend.domain.gift.entity.Gift; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
|
||
public interface GiftRepository extends JpaRepository<Gift, Long> { | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/org/kakaoshare/backend/domain/hashtag/entity/Hashtag.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 org.kakaoshare.backend.domain.hashtag.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.OneToMany; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import org.kakaoshare.backend.domain.base.entity.BaseTimeEntity; | ||
|
||
|
||
@Entity | ||
@Getter | ||
public class Hashtag extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long hashtagId; | ||
|
||
@Column(nullable = false) | ||
private String name; | ||
|
||
@OneToMany(mappedBy = "hashtag") | ||
private List<ProductHashtag> ProductHashtags; | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/org/kakaoshare/backend/domain/hashtag/entity/ProductHashtag.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,31 @@ | ||
package org.kakaoshare.backend.domain.hashtag.entity; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import lombok.Getter; | ||
import org.kakaoshare.backend.domain.base.entity.BaseTimeEntity; | ||
import org.kakaoshare.backend.domain.hashtag.entity.Hashtag; | ||
import org.kakaoshare.backend.domain.product.entity.Product; | ||
|
||
|
||
@Entity | ||
@Getter | ||
public class ProductHashtag extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long productHashtagId; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "hashtag_id", nullable = false) | ||
private Hashtag hashtag; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "product_id", nullable = false) | ||
private Product product; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/org/kakaoshare/backend/domain/hashtag/repository/HashtagRepository.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,8 @@ | ||
package org.kakaoshare.backend.domain.hashtag.repository; | ||
|
||
import org.kakaoshare.backend.domain.hashtag.entity.Hashtag; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
|
||
public interface HashtagRepository extends JpaRepository<Hashtag, Long> { | ||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/org/kakaoshare/backend/domain/member/entity/Member.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,42 @@ | ||
package org.kakaoshare.backend.domain.member.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.OneToMany; | ||
import java.util.List; | ||
import lombok.Getter; | ||
import org.kakaoshare.backend.domain.base.entity.BaseTimeEntity; | ||
import org.kakaoshare.backend.domain.order.entity.Order; | ||
import org.kakaoshare.backend.domain.funding.entity.Funding; | ||
|
||
|
||
@Entity | ||
@Getter | ||
public class Member extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long memberId; | ||
|
||
@Column(nullable = false) | ||
private String email; | ||
|
||
@Column(nullable = false, length = 20) | ||
private String phoneNumber; | ||
|
||
@Column | ||
private String kakaoId; | ||
|
||
@Column | ||
private String kakaoUuid; | ||
|
||
@OneToMany(mappedBy = "member") | ||
private List<Order> orders; | ||
|
||
@OneToMany(mappedBy = "member") | ||
private List<Funding> funding; | ||
|
||
} |
Oops, something went wrong.