-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT #33] 성지순례 인증하기 api 개발 및 CompleteRally 엔티티 추가
- Loading branch information
Showing
4 changed files
with
97 additions
and
19 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/main/java/com/favoriteplace/app/domain/enums/RallyVersion.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,13 @@ | ||
package com.favoriteplace.app.domain.enums; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum RallyVersion { | ||
v1("BETA 1.0"); | ||
private final String version; | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/favoriteplace/app/domain/travel/CompleteRally.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,27 @@ | ||
package com.favoriteplace.app.domain.travel; | ||
|
||
import com.favoriteplace.app.domain.Member; | ||
import com.favoriteplace.app.domain.common.BaseTimeEntity; | ||
import com.favoriteplace.app.domain.enums.RallyVersion; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Getter | ||
@Builder | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class CompleteRally extends BaseTimeEntity { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name="complete_rally_id") | ||
private Long id; | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "rally_id", nullable = false) | ||
private Rally rally; | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "member_id", nullable = false) | ||
private Member member; | ||
@Enumerated(EnumType.STRING) | ||
private RallyVersion version; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/favoriteplace/app/repository/CompleteRallyRepository.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,12 @@ | ||
package com.favoriteplace.app.repository; | ||
|
||
import com.favoriteplace.app.domain.Member; | ||
import com.favoriteplace.app.domain.travel.CompleteRally; | ||
import com.favoriteplace.app.domain.travel.Rally; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface CompleteRallyRepository extends JpaRepository<CompleteRally, Long> { | ||
CompleteRally findByMemberAndRally(Member member, Rally rally); | ||
} |
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