-
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.
Merge pull request #197 from capstone-maru/dev
Dev
- Loading branch information
Showing
3 changed files
with
65 additions
and
14 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/main/java/org/capstone/maru/domain/MemberRecommendUpdate.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,30 @@ | ||
package org.capstone.maru.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import java.time.Duration; | ||
import java.time.LocalDateTime; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Entity | ||
public class MemberRecommendUpdate { | ||
|
||
@Id | ||
private String memberId; | ||
|
||
private LocalDateTime recommendUpdateAt; | ||
|
||
public MemberRecommendUpdate(String memberId, LocalDateTime recommendUpdateAt) { | ||
this.memberId = memberId; | ||
this.recommendUpdateAt = LocalDateTime.now(); | ||
} | ||
|
||
public Boolean haveToUpdate(LocalDateTime now) { | ||
|
||
Duration duration = Duration.between(recommendUpdateAt, now); | ||
|
||
// 차이가 30분인지 확인 | ||
return duration.equals(Duration.ofMinutes(30)); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/org/capstone/maru/repository/postgre/MemberRecommendUpdateRepository.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 org.capstone.maru.repository.postgre; | ||
|
||
import org.capstone.maru.domain.MemberRecommendUpdate; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface MemberRecommendUpdateRepository extends | ||
JpaRepository<MemberRecommendUpdate, String> { | ||
|
||
} |
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