Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,20 @@ repositories {
}

dependencies {
// ✅ 웹서버 실행 위해 Web 스타터 추가 (CI 확인용 간단 서버)
// 기본 웹 서버
implementation 'org.springframework.boot:spring-boot-starter-web'

// ✅ 테스트 관련
// JPA (DB 매핑용)
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

// MySQL 드라이버
runtimeOnly 'com.mysql:mysql-connector-j'

// Lombok (getter/setter, builder, etc.)
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

// 테스트 관련
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/example/UMC/UmcApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

@EnableJpaAuditing
@SpringBootApplication
public class UmcApplication {

Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/example/UMC/domain/BaseEntity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.UMC.domain;

import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.LocalDateTime;

@Getter
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class BaseEntity {
@CreationTimestamp
@Column(name = "created_at", nullable = false)
private LocalDateTime createdAt;

@UpdateTimestamp
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;
}
5 changes: 5 additions & 0 deletions src/main/java/com/example/UMC/domain/enums/Gender.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.example.UMC.domain.enums;

public enum Gender {
M, F, UNKNOWN
}
5 changes: 5 additions & 0 deletions src/main/java/com/example/UMC/domain/enums/MissionStatus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.example.UMC.domain.enums;

public enum MissionStatus {
NOT_STARTED, CANCEL, PROCESS, COMPLETE
}
5 changes: 5 additions & 0 deletions src/main/java/com/example/UMC/domain/enums/Status.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.example.UMC.domain.enums;

public enum Status {
ACTIVE, LOCK
}
21 changes: 21 additions & 0 deletions src/main/java/com/example/UMC/domain/likes/LikeCategory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.example.UMC.domain.likes;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "like_category")
public class LikeCategory {

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

@Column(name = "category_name", nullable = false, length = 20)
private String name;
}
27 changes: 27 additions & 0 deletions src/main/java/com/example/UMC/domain/likes/UserLikeFood.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.example.UMC.domain.likes;

import com.example.UMC.domain.user.User;
import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "user_like_food")
public class UserLikeFood {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "user_like_food_id")
private Long id;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "category_id", nullable = false)
private LikeCategory category;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
private User user;
}
47 changes: 47 additions & 0 deletions src/main/java/com/example/UMC/domain/mission/Mission.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.example.UMC.domain.mission;

import com.example.UMC.domain.store.Store;
import com.example.UMC.domain.store.Region;
import jakarta.persistence.*;
import lombok.*;
import java.time.LocalDateTime;

@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "misson")
public class Mission {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "misson_id")
private Long id;

@Column(name = "title", nullable = false, length = 120)
private String title;

@Column(name = "description", columnDefinition = "TEXT")
private String description;

@Column(name = "min_spend")
private Integer minSpend;

@Column(name = "point")
private Integer point;

@Column(name = "starts_at")
private LocalDateTime startsAt;

@Column(name = "ends_at")
private LocalDateTime endsAt;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "store_id", nullable = false)
private Store store;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "resion_id", nullable = false)
private Region region;
}
47 changes: 47 additions & 0 deletions src/main/java/com/example/UMC/domain/mission/UserMission.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.example.UMC.domain.mission;

import com.example.UMC.domain.enums.MissionStatus;
import com.example.UMC.domain.store.Region;
import com.example.UMC.domain.user.User;
import jakarta.persistence.*;
import lombok.*;
import java.time.LocalDateTime;

@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "user_misson")
public class UserMission {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "user_misson_id")
private Long id;

@Column(name = "verrification_code", length = 16)
private String verificationCode;

@Enumerated(EnumType.STRING)
@Column(name = "status", nullable = false, length = 20)
private MissionStatus status;

@Column(name = "challenge_at")
private LocalDateTime challengeAt;

@Column(name = "completed_at")
private LocalDateTime completedAt;

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

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "misson_id", nullable = false)
private Mission mission;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "resion_id", nullable = false)
private Region region;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.example.UMC.domain.notification;


import com.example.UMC.domain.BaseEntity;
import com.example.UMC.domain.user.User;
import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "notification")
public class Notification extends BaseEntity {

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

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

@Column(name = "is_notification", nullable = false)
private Boolean isNotification;

@Column(name = "is_read", nullable = false)
private Boolean isRead;
}

40 changes: 40 additions & 0 deletions src/main/java/com/example/UMC/domain/review/Review.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.example.UMC.domain.review;

import com.example.UMC.domain.BaseEntity;
import com.example.UMC.domain.store.Region;
import com.example.UMC.domain.store.Store;
import com.example.UMC.domain.user.User;
import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "review")
public class Review extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "review_id")
private Long id;

@Column(name = "rating", nullable = false)
private Integer rating;

@Column(name = "content", columnDefinition = "TEXT")
private String content;

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

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "store_id", nullable = false)
private Store store;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "resion_id", nullable = false)
private Region region;
}
31 changes: 31 additions & 0 deletions src/main/java/com/example/UMC/domain/review/ReviewImage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.example.UMC.domain.review;

import com.example.UMC.domain.store.Region;
import com.example.UMC.domain.user.User;
import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "review_img")
public class ReviewImage {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "review_img_id")
private Long id;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "review_id", nullable = false)
private Review review;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "resion_id", nullable = false)
private Region region;

@Column(name = "review_img_url", nullable = false, length = 255)
private String imageUrl;
}
35 changes: 35 additions & 0 deletions src/main/java/com/example/UMC/domain/review/ReviewReply.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.example.UMC.domain.review;

import com.example.UMC.domain.store.Region;
import com.example.UMC.domain.user.User;
import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "review_replies")
public class ReviewReply {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "review_reply_id")
private Long id;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "review_id", nullable = false)
private Review review;

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

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "resion_id", nullable = false)
private Region region;

@Column(name = "review_reply_text", columnDefinition = "TEXT")
private String text;
}
21 changes: 21 additions & 0 deletions src/main/java/com/example/UMC/domain/store/Region.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.example.UMC.domain.store;

import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table(name = "resion")
public class Region {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "resion_id")
private Long id;

@Column(name = "resion_name", nullable = false, length = 255)
private String name;
}
Loading