Skip to content

Commit

Permalink
🐛 Fix: application-prod-> ddl-auto: update로 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
lej8924 committed Jul 23, 2024
1 parent 63fe617 commit 2da70d7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.Getter;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Getter
@AllArgsConstructor
Expand All @@ -16,7 +17,7 @@ public class NoteResponse {
PageInfo pageInfo;
private Long noteId;
private String content;
private LocalDateTime memoDate;
private String memoDate;
private Long postId;
private String postTitle;
private String targetText;
Expand All @@ -26,7 +27,7 @@ public static NoteResponse toDto(Memo memo,PageInfo pageInfo){
.pageInfo(pageInfo)
.noteId(memo.getMemoId())
.content(memo.getContent())
.memoDate(memo.getCreatedDate())
.memoDate(memo.getCreatedDate().format(DateTimeFormatter.ISO_DATE_TIME))
.postId(memo.getPost().getPostId())
.postTitle(memo.getPost().getTitle())
.targetText(memo.getTargetText())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public void run(ApplicationArguments args) throws Exception {
User user1 = userRepository.findById(1L).orElseThrow();
User user2 = userRepository.findById(2L).orElseThrow();
User user3 = userRepository.findById(3L).orElseThrow();
User user4 = userRepository.findById(4L).orElseThrow();
User user5 = userRepository.findById(5L).orElseThrow();


Opinion opinion1 = opinionRepository.findById(1L).orElseThrow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public void run(ApplicationArguments args) throws Exception {
if (postRepository.count() > 0) {
log.info("[Post] 더미 데이터 존재");
} else {
List<Post> postList = new ArrayList<>();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

Post post1 = Post.builder()
Expand Down Expand Up @@ -457,36 +456,15 @@ public void run(ApplicationArguments args) throws Exception {
.scrapCount(1)
.build();

postList.add(post1);
postList.add(post2);
postList.add(post3);
postList.add(post4);
postList.add(post5);
postList.add(post6);
postList.add(post7);
postList.add(post8);
postList.add(post9);
postList.add(post10);
postList.add(post11);
postList.add(post12);
postList.add(post13);
postList.add(post14);
postList.add(post15);
postList.add(post16);
postList.add(post17);
postList.add(post18);
postList.add(post19);
postList.add(post20);
postList.add(post21);
postList.add(post22);
postList.add(post23);
postList.add(post24);
postList.add(post25);
postList.add(post26);
postList.add(post27);
postList.add(post28);
postList.add(post29);
postList.add(post30);
List<Post> postList = new ArrayList<>();

Post[] posts = {post1, post2, post3, post4, post5, post6, post7, post8, post9, post10,
post11, post12, post13, post14, post15, post16, post17, post18, post19, post20,
post21, post22, post23, post24, post25, post26, post27, post28, post29, post30};

for (Post post : posts) {
postList.add(post);
}

postRepository.saveAll(postList);
}
Expand Down

0 comments on commit 2da70d7

Please sign in to comment.