Skip to content

Commit

Permalink
Merge pull request #19 from Sam3Star/gayeong
Browse files Browse the repository at this point in the history
fix: fix
  • Loading branch information
GayeongKimm authored Jun 26, 2024
2 parents ce17220 + 6701b3a commit 487b99d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

@Repository
public interface RoutineRepository extends JpaRepository<RoutineEntity, Long> {
@Query("SELECT r FROM RoutineEntity r WHERE r.modifiedDateTime = :today")
List<RoutineEntity> findModifiedToday(@Param("today") LocalDateTime today);
@Query("SELECT r FROM RoutineEntity r WHERE r.modifiedDate = :today")
List<RoutineEntity> findModifiedToday(@Param("today") LocalDate today);
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void delete(Long id) {

@Override
public List<RoutineLoadRes> loadRoutine() {
List<RoutineEntity> routineEntity = routineRepository.findModifiedToday(LocalDateTime.now());
List<RoutineEntity> routineEntity = routineRepository.findModifiedToday(LocalDate.now());

List<RoutineLoadRes> routineLoadResList = new ArrayList<>();
for (RoutineEntity routine : routineEntity){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Getter
Expand All @@ -20,10 +21,10 @@
@EntityListeners(AuditingEntityListener.class)
public abstract class BaseTimeEntity {
@CreatedDate
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
protected LocalDateTime createdDateTime;
@JsonFormat(pattern = "yyyy-MM-dd")
protected LocalDate createdDate;

@LastModifiedDate
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
protected LocalDateTime modifiedDateTime;
@JsonFormat(pattern = "yyyy-MM-dd")
protected LocalDate modifiedDate;
}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spring:

jpa:
hibernate:
ddl-auto: none
ddl-auto: create
properties:
hibernate:
format_sql: true
Expand Down

0 comments on commit 487b99d

Please sign in to comment.