-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] DB 생성 #10
Merged
Merged
[feat] DB 생성 #10
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
60a2bf9
#1 feat: enum값 정의
sojungpp d0c42a9
#1 feat: DB 컬럼 생성
sojungpp a63f1cf
#1 feat: varchar 길이 제한 추가
sojungpp 58fcac2
#1 feat: likeNum default값 설정
sojungpp 6d48d4d
#1 feat: InquiryStatus 추가
sojungpp 2582947
#1 fix: JoinColumn idx -> id 로 변경
sojungpp b88877a
#1 feat: enumType String으로 추가
sojungpp 20d0c70
#1 fix: 이미지 컬럼명 imgKey로 통일
sojungpp feb1222
#1 fix: reportCategory 종류 수정
sojungpp 1965998
#1 fix: reportCategory notnull 추가
sojungpp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -1,13 +1,20 @@ | ||
package com.psr.psr.chat.entity | ||
|
||
import com.psr.psr.global.entity.BaseEntity | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import com.psr.psr.user.entity.User | ||
import jakarta.persistence.* | ||
|
||
@Entity | ||
data class ChatRoom( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
var id: Long | ||
var id: Long, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "sender_user_id") | ||
var senderUser: User, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "receiver_user_id") | ||
var receiverUser: User | ||
|
||
): BaseEntity() |
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 |
---|---|---|
@@ -1,13 +1,23 @@ | ||
package com.psr.psr.cs.entity | ||
|
||
import com.psr.psr.global.entity.BaseEntity | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import jakarta.persistence.* | ||
import org.jetbrains.annotations.NotNull | ||
|
||
@Entity | ||
data class Faq( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
var id: Long | ||
var id: Long, | ||
|
||
@NotNull | ||
@Column(length = 100) | ||
var title: String, | ||
|
||
@NotNull | ||
var content: String, | ||
|
||
@NotNull | ||
@Enumerated(EnumType.STRING) | ||
var type: FaqType | ||
|
||
): BaseEntity() |
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 com.psr.psr.cs.entity | ||
|
||
enum class FaqType(val value: String) { | ||
ACCOUNT_MANAGEMENT("계정관리"), | ||
CONSULTING("컨설팅"), | ||
PRODUCT("상품") | ||
} |
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 |
---|---|---|
@@ -1,13 +1,26 @@ | ||
package com.psr.psr.cs.entity | ||
|
||
import com.psr.psr.global.entity.BaseEntity | ||
import jakarta.persistence.Column | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import org.jetbrains.annotations.NotNull | ||
|
||
@Entity | ||
data class Notice( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
var id: Long | ||
var id: Long, | ||
|
||
@NotNull | ||
@Column(length = 100) | ||
var title: String, | ||
|
||
@NotNull | ||
@Column(length = 500) | ||
var content: String, | ||
|
||
var imgKey: String | ||
sojungpp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
): BaseEntity() |
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 |
---|---|---|
@@ -1,13 +1,30 @@ | ||
package com.psr.psr.inquiry.entity | ||
|
||
import com.psr.psr.global.entity.BaseEntity | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import com.psr.psr.user.entity.User | ||
import jakarta.persistence.* | ||
import org.jetbrains.annotations.NotNull | ||
|
||
@Entity | ||
data class Inquiry( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
var id: Long | ||
var id: Long, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "user_id") | ||
var user: User, | ||
|
||
@NotNull | ||
@Column(length = 100) | ||
var title: String, | ||
|
||
@NotNull | ||
var content: String, | ||
|
||
@NotNull | ||
@Enumerated(EnumType.STRING) | ||
var inquiryStatus: InquiryStatus, | ||
|
||
var answer: String | ||
sojungpp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
): BaseEntity() |
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,6 @@ | ||
package com.psr.psr.inquiry.entity | ||
|
||
enum class InquiryStatus(val value: String) { | ||
PROGRESSING("진행중"), | ||
COMPLETED("완료") | ||
} |
16 changes: 11 additions & 5 deletions
16
src/main/kotlin/com/psr/psr/notification/entity/Notification.kt
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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
package com.psr.psr.notification.entity | ||
|
||
import com.psr.psr.global.entity.BaseEntity | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import jakarta.persistence.* | ||
import org.jetbrains.annotations.NotNull | ||
|
||
@Entity | ||
data class Notification( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
var id: Long | ||
var id: Long, | ||
|
||
@NotNull | ||
@Column(length = 100) | ||
var title: String, | ||
|
||
@NotNull | ||
var content: String | ||
|
||
): BaseEntity() |
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 |
---|---|---|
@@ -1,13 +1,39 @@ | ||
package com.psr.psr.order.entity | ||
|
||
import com.psr.psr.global.entity.BaseEntity | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import com.psr.psr.product.entity.product.Product | ||
import com.psr.psr.user.entity.User | ||
import jakarta.persistence.* | ||
import org.jetbrains.annotations.NotNull | ||
|
||
@Entity | ||
data class Order( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
var id: Long | ||
var id: Long, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "product_id") | ||
var product: Product, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "user_id") | ||
var user: User, | ||
|
||
@NotNull | ||
@Column(length = 100) | ||
var ordererName: String, | ||
|
||
@NotNull | ||
var websiteUrl: String, | ||
|
||
@NotNull | ||
@Enumerated(EnumType.STRING) | ||
var orderStatus: OrderStatus, | ||
|
||
@NotNull | ||
var inquiry: String, | ||
|
||
@NotNull | ||
var description: String | ||
|
||
): BaseEntity() |
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 com.psr.psr.order.entity | ||
|
||
enum class OrderStatus(val value: String) { | ||
ORDER_WAITING("요청대기"), | ||
PROGRESSING("진행중"), | ||
COMPLETED("진행완료"), | ||
CANCELED("요청취소") | ||
} |
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,9 @@ | ||
package com.psr.psr.product.entity | ||
|
||
enum class ReportCategory(val value: String) { | ||
JUNK("스팸홍보/도배"), | ||
ABUSE("욕설/혐오/차별"), | ||
PORN("음란물/유해한 정보"), | ||
FRAUD("사기/불법정보"), | ||
NOT_FIT("게시글 성격에 부적합함") | ||
} |
31 changes: 26 additions & 5 deletions
31
src/main/kotlin/com/psr/psr/product/entity/product/Product.kt
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 |
---|---|---|
@@ -1,13 +1,34 @@ | ||
package com.psr.psr.product.entity.product | ||
|
||
import com.psr.psr.global.entity.BaseEntity | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import com.psr.psr.user.entity.Category | ||
import com.psr.psr.user.entity.User | ||
import jakarta.persistence.* | ||
import org.jetbrains.annotations.NotNull | ||
|
||
@Entity | ||
data class Product( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
var id: Long | ||
var id: Long, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "user_id") | ||
var user: User, | ||
|
||
@NotNull | ||
@Column(length = 50) | ||
var name: String, | ||
|
||
@NotNull | ||
@Enumerated(EnumType.STRING) | ||
var category: Category, | ||
|
||
@NotNull | ||
var price: Int, | ||
|
||
@NotNull | ||
var description: String, | ||
|
||
var likeNum: Int = 0 | ||
|
||
): BaseEntity() |
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
17 changes: 12 additions & 5 deletions
17
src/main/kotlin/com/psr/psr/product/entity/product/ProductLike.kt
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 |
---|---|---|
@@ -1,13 +1,20 @@ | ||
package com.psr.psr.product.entity.product | ||
|
||
import com.psr.psr.global.entity.BaseEntity | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import com.psr.psr.user.entity.User | ||
import jakarta.persistence.* | ||
|
||
@Entity | ||
data class ProductLike( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
var id: Long | ||
var id: Long, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "product_id") | ||
var product: Product, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "user_id") | ||
var user: User | ||
|
||
): BaseEntity() |
23 changes: 18 additions & 5 deletions
23
src/main/kotlin/com/psr/psr/product/entity/product/ProductReport.kt
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 |
---|---|---|
@@ -1,13 +1,26 @@ | ||
package com.psr.psr.product.entity.product | ||
|
||
import com.psr.psr.global.entity.BaseEntity | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import com.psr.psr.product.entity.ReportCategory | ||
import com.psr.psr.user.entity.User | ||
import jakarta.persistence.* | ||
import org.jetbrains.annotations.NotNull | ||
|
||
@Entity | ||
data class ProductReport( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
var id: Long | ||
var id: Long, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "product_id") | ||
var product: Product, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "user_id") | ||
var user: User, | ||
|
||
@NotNull | ||
@Enumerated(EnumType.STRING) | ||
var category: ReportCategory | ||
|
||
): BaseEntity() |
26 changes: 20 additions & 6 deletions
26
src/main/kotlin/com/psr/psr/product/entity/review/Review.kt
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 |
---|---|---|
@@ -1,13 +1,27 @@ | ||
package com.psr.psr.product.entity.review | ||
|
||
import com.psr.psr.global.entity.BaseEntity | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
import com.psr.psr.product.entity.product.Product | ||
import com.psr.psr.user.entity.User | ||
import jakarta.persistence.* | ||
import org.jetbrains.annotations.NotNull | ||
|
||
@Entity | ||
data class Review( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
var id: Long | ||
): BaseEntity() | ||
var id: Long, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "product_id") | ||
var product: Product, | ||
|
||
@ManyToOne | ||
@JoinColumn(nullable = false, name = "user_id") | ||
var user: User, | ||
|
||
@NotNull | ||
var rating: Int, | ||
|
||
var content: String | ||
|
||
): BaseEntity() |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum 쓴 부분은
@Enumerated(EnumType.STRING)
가 필요할 것 같습니다!지금 DB에는 tinyint로 되어있어용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
감사합니당당 수정완!!