-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix: domain entity 분리 * Fix: member 도메인을 사용하도록 수정 * Test: member repository 테스트 추가 * Test: entity test 추가
- Loading branch information
Showing
45 changed files
with
773 additions
and
342 deletions.
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
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.dnd.runus.domain.badge; | ||
|
||
import com.dnd.runus.global.constant.BadgeType; | ||
|
||
public record Badge( | ||
long badgeId, String name, String description, String imageUrl, BadgeType type, int requiredValue) {} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/dnd/runus/domain/badge/BadgeAchievement.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.dnd.runus.domain.badge; | ||
|
||
import com.dnd.runus.domain.member.Member; | ||
|
||
import java.time.OffsetDateTime; | ||
|
||
public record BadgeAchievement(Badge badge, Member member, OffsetDateTime createdAt, OffsetDateTime updatedAt) {} |
33 changes: 0 additions & 33 deletions
33
src/main/java/com/dnd/runus/domain/badge/entity/BadgeAchievement.java
This file was deleted.
Oops, something went wrong.
24 changes: 14 additions & 10 deletions
24
src/main/java/com/dnd/runus/domain/common/BaseTimeEntity.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 |
---|---|---|
@@ -1,21 +1,25 @@ | ||
package com.dnd.runus.domain.common; | ||
|
||
import jakarta.persistence.EntityListeners; | ||
import jakarta.persistence.MappedSuperclass; | ||
import jakarta.persistence.PrePersist; | ||
import jakarta.persistence.PreUpdate; | ||
import lombok.Getter; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import java.time.Instant; | ||
import java.time.OffsetDateTime; | ||
|
||
@Getter | ||
@MappedSuperclass | ||
@EntityListeners(AuditingEntityListener.class) | ||
public abstract class BaseTimeEntity { | ||
@CreatedDate | ||
private Instant createdAt; | ||
private OffsetDateTime createdAt; | ||
private OffsetDateTime updatedAt; | ||
|
||
@LastModifiedDate | ||
private Instant updatedAt; | ||
@PrePersist | ||
public void prePersist() { | ||
createdAt = updatedAt = OffsetDateTime.now(); | ||
} | ||
|
||
@PreUpdate | ||
public void preUpdate() { | ||
updatedAt = OffsetDateTime.now(); | ||
} | ||
} |
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,14 @@ | ||
package com.dnd.runus.domain.common; | ||
|
||
/** | ||
* @param longitude 경도 | ||
* @param latitude 위도 | ||
* @param altitude 고도 | ||
*/ | ||
public record Coordinate(double longitude, double latitude, double altitude) { | ||
public static final double NULL_ORDINATE = Double.NaN; | ||
|
||
public Coordinate(double longitude, double latitude) { | ||
this(longitude, latitude, NULL_ORDINATE); | ||
} | ||
} |
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,3 @@ | ||
package com.dnd.runus.domain.level; | ||
|
||
public record Level(long levelId, int requiredExp) {} |
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,20 @@ | ||
package com.dnd.runus.domain.member; | ||
|
||
import com.dnd.runus.domain.badge.Badge; | ||
import com.dnd.runus.domain.level.Level; | ||
import com.dnd.runus.global.constant.MemberRole; | ||
import lombok.Builder; | ||
|
||
import java.time.OffsetDateTime; | ||
|
||
@Builder | ||
public record Member( | ||
long memberId, | ||
OffsetDateTime createdAt, | ||
OffsetDateTime updatedAt, | ||
MemberRole role, | ||
String nickname, | ||
Badge mainBadge, | ||
int weightKg, | ||
Level level, | ||
int currentExp) {} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/dnd/runus/domain/member/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,9 @@ | ||
package com.dnd.runus.domain.member; | ||
|
||
import java.util.Optional; | ||
|
||
public interface MemberRepository { | ||
Optional<Member> findById(long id); | ||
|
||
Member save(Member member); | ||
} |
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.dnd.runus.domain.member; | ||
|
||
import com.dnd.runus.global.constant.SocialType; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record SocialProfile( | ||
long socialProfileId, SocialType socialType, String oauthId, String oauthEmail, long memberId) {} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/dnd/runus/domain/member/SocialProfileRepository.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,15 @@ | ||
package com.dnd.runus.domain.member; | ||
|
||
import com.dnd.runus.global.constant.SocialType; | ||
|
||
import java.util.Optional; | ||
|
||
public interface SocialProfileRepository { | ||
Optional<SocialProfile> findById(Long socialProfileId); | ||
|
||
Optional<SocialProfile> findBySocialTypeAndOauthId(SocialType socialType, String oauthId); | ||
|
||
SocialProfile save(SocialProfile socialProfile); | ||
|
||
void updateOauthEmail(long socialProfileId, String oauthEmail); | ||
} |
44 changes: 0 additions & 44 deletions
44
src/main/java/com/dnd/runus/domain/member/entity/Member.java
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
src/main/java/com/dnd/runus/domain/member/entity/PersonalProfile.java
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
src/main/java/com/dnd/runus/domain/member/entity/SocialProfile.java
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/main/java/com/dnd/runus/domain/member/repository/MemberRepository.java
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/main/java/com/dnd/runus/domain/member/repository/SocialProfileRepository.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.