Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : 댓글 생성 시 생성 날짜 로직 수정 #220

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public void updateComment(String content) {
this.updatedAt = LocalDateTime.now();
}

public Comment(User user, String content, LocalDateTime createdAt) {
public Comment(User user, String content) {
this.user = user;
this.content = content;
this.createdAt = createdAt;
this.createdAt = LocalDateTime.now();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.gamzabat.algohub.feature.notice.domain;

import java.time.LocalDateTime;

import org.hibernate.annotations.DynamicUpdate;

import com.gamzabat.algohub.feature.comment.domain.Comment;
Expand All @@ -26,9 +24,8 @@ public class NoticeComment extends Comment {
private Notice notice;

@Builder
public NoticeComment(User user, String content,
LocalDateTime createdAt, Notice notice) {
super(user, content, createdAt);
public NoticeComment(User user, String content, Notice notice) {
super(user, content);
this.notice = notice;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.gamzabat.algohub.feature.solution.domain;

import java.time.LocalDateTime;

import org.hibernate.annotations.DynamicUpdate;

import com.gamzabat.algohub.feature.comment.domain.Comment;
Expand All @@ -26,8 +24,8 @@ public class SolutionComment extends Comment {
private Solution solution;

@Builder
public SolutionComment(Solution solution, User user, String content, LocalDateTime createdAt) {
super(user, content, createdAt);
public SolutionComment(Solution solution, User user, String content) {
super(user, content);
this.solution = solution;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.gamzabat.algohub.feature.solution.service;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -54,7 +53,6 @@ public void createComment(User user, Long solutionId, CreateSolutionCommentReque
.user(user)
.solution(solution)
.content(request.content())
.createdAt(LocalDateTime.now())
.build());

sendCommentNotification(user, solution);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ void getComment_1() {
for (int i = 0; i < 30; i++)
list.add(NoticeComment.builder()
.notice(notice)
.createdAt(LocalDateTime.now())
.user(user)
.content("content" + i)
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ void getComment_1() {
for (int i = 0; i < 30; i++)
list.add(SolutionComment.builder()
.solution(solution)
.createdAt(LocalDateTime.now())
.user(user)
.content("content" + i)
.build());
Expand Down