-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from GDSC-Hongik/mirupio
feat: 엔티티 클래스 개발
- Loading branch information
Showing
6 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/main/java/com/untitled/cherrymap/domain/AlertMessage.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,24 @@ | ||
package com.untitled.cherrymap.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Entity | ||
@Getter @Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Table(name = "alert_message") | ||
public class AlertMessage { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long alertMessageId; | ||
|
||
@Column(nullable = false, length = 10) | ||
private String mode; | ||
|
||
@Column(nullable = false, columnDefinition = "TEXT") | ||
private String alertText; | ||
} |
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,26 @@ | ||
package com.untitled.cherrymap.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
public class Member { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
private String nickname; | ||
|
||
private String email; | ||
|
||
private String providerId; // 카카오 고유 id | ||
} |
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 com.untitled.cherrymap.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Getter @Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Table(name = "route") | ||
public class Route { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long routeId; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "member_id",nullable = false) | ||
private Member member; | ||
|
||
@Column(nullable = false, length = 20) | ||
private String routeName; | ||
|
||
@Column(nullable = false, length = 20) | ||
private String startName; | ||
|
||
@Column(nullable = false) | ||
private double startLat; | ||
|
||
@Column(nullable = false) | ||
private double startLng; | ||
|
||
@Column(nullable = false, length = 20) | ||
private String endName; | ||
|
||
@Column(nullable = false) | ||
private double endLat; | ||
|
||
@Column(nullable = false) | ||
private double endLng; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/untitled/cherrymap/repository/AlertMessageRepository.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 com.untitled.cherrymap.repository; | ||
|
||
import com.untitled.cherrymap.domain.AlertMessage; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface AlertMessageRepository extends JpaRepository<AlertMessage, Long> { | ||
AlertMessage findByMode(String mode); | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/untitled/cherrymap/repository/MemberRepository.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 com.untitled.cherrymap.repository; | ||
|
||
import com.untitled.cherrymap.domain.Member; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface MemberRepository extends JpaRepository<Member, Long> { | ||
Member findByProviderId(String providerId); | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/untitled/cherrymap/repository/RouteRepository.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 com.untitled.cherrymap.repository; | ||
|
||
import com.untitled.cherrymap.domain.Route; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface RouteRepository extends JpaRepository<Route, Long> { | ||
} |