Skip to content

Commit

Permalink
Merge branch 'master' into feat/chat
Browse files Browse the repository at this point in the history
  • Loading branch information
summit45 authored Nov 2, 2023
2 parents 491758b + c6afe1d commit 3ed215e
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ out/

### JREBEL ###
rebel.xml

33 changes: 33 additions & 0 deletions src/main/java/com/kusitms/jipbap/food/Cart.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.kusitms.jipbap.food;

import com.kusitms.jipbap.common.entity.DateEntity;
import com.kusitms.jipbap.store.Store;
import com.kusitms.jipbap.user.User;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Table(name = "tb_cart")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Cart extends DateEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name ="cart_id")
private Long id; //고유 pk

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn
private User user;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn
private Food food;

}
26 changes: 26 additions & 0 deletions src/main/java/com/kusitms/jipbap/food/Category.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.kusitms.jipbap.food;

import com.kusitms.jipbap.common.entity.DateEntity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Table(name = "tb_category")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Category extends DateEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name ="category_id")
private Long id; //고유 pk

private String name;
private String image;

}
38 changes: 38 additions & 0 deletions src/main/java/com/kusitms/jipbap/food/Food.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.kusitms.jipbap.food;

import com.kusitms.jipbap.common.entity.DateEntity;
import com.kusitms.jipbap.store.Store;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.ColumnDefault;

@Entity
@Table(name = "tb_food")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Food extends DateEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name ="food_id")
private Long id; //고유 pk

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn
private Store store;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn
private Category category;

private String name;
private Long price;
private String description;
private Long recommendCount;

}
41 changes: 41 additions & 0 deletions src/main/java/com/kusitms/jipbap/notifiication/Notification.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.kusitms.jipbap.notifiication;

import com.kusitms.jipbap.common.entity.DateEntity;
import com.kusitms.jipbap.user.User;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.ColumnDefault;

@Entity
@Table(name = "tb_notification")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Notification extends DateEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name ="notification_id")
private Long id; //고유 pk

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id")
private User user;

@Enumerated(EnumType.STRING)
private NotificationType notificationType;

private String message;

@ColumnDefault("false")
@Column(columnDefinition = "TINYINT(1)")
private Boolean readYn;

public enum NotificationType {
OFFER, CHAT, REVIEW, WISHLIST
}
}
41 changes: 41 additions & 0 deletions src/main/java/com/kusitms/jipbap/post/Post.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.kusitms.jipbap.post;

import com.kusitms.jipbap.common.entity.DateEntity;
import com.kusitms.jipbap.user.Role;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;

@Entity
@Table(name = "tb_post")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Post extends DateEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name ="post_id")
private Long id; //고유 pk

@Enumerated(EnumType.STRING)
private PostType postType;

private String title;
private String content;
private Long hit;

private LocalDateTime createdBy;
private LocalDateTime updatedBy;


public enum PostType {
STANDBY, APPROVE, SUSPEND
}
}
5 changes: 3 additions & 2 deletions src/main/java/com/kusitms/jipbap/store/Store.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ public class Store extends DateEntity {
@JoinColumn
private User owner;

//TODO("읍면동 지역 id?")
private String name;
private String description;

@ColumnDefault("false")
@Column(columnDefinition = "TINYINT(1)")
private Boolean koreanYn; //한국인 인증 여부

private Boolean koreanYn;
private Double avgRate;

private String image;
Expand Down
35 changes: 35 additions & 0 deletions src/main/java/com/kusitms/jipbap/store/StoreBookmark.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.kusitms.jipbap.store;

import com.kusitms.jipbap.common.entity.DateEntity;
import com.kusitms.jipbap.user.User;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.ColumnDefault;

@Entity
@Table(name = "tb_store_bookmark")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class StoreBookmark extends DateEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name ="store_bookmark_id")
private Long id; //고유 pk

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn
private User owner;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn
private Store store;



}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spring:
jpa:
open-in-view: true
hibernate:
ddl-auto: update
ddl-auto: create
show-sql: true
properties:
hibernate:
Expand Down

0 comments on commit 3ed215e

Please sign in to comment.