Skip to content

Commit

Permalink
feat #218 : reply report 관련 dto 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene225 committed Jul 15, 2024
1 parent d825e48 commit bf92f45
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.prgms.locomocoserver.report.dto;

import org.prgms.locomocoserver.report.domain.ReplyReport;

public record ReplyReportDto(
Long reporter,
Long replyId,
String content
) {
public static ReplyReportDto of(ReplyReport replyReport) {
return new ReplyReportDto(replyReport.getReporter().getId(), replyReport.getId(), replyReport.getContent());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.prgms.locomocoserver.report.dto.request;

import org.prgms.locomocoserver.replies.domain.Reply;
import org.prgms.locomocoserver.report.domain.ReplyReport;
import org.prgms.locomocoserver.user.domain.User;

public record ReplyReportCreateRequest(
Long replyId,
Long userId,
String content
) {
public static ReplyReport toEntity(User reporter, Reply reply, String content) {
return ReplyReport.builder()
.reporter(reporter)
.reply(reply)
.content(content)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.prgms.locomocoserver.report.dto.request;

public record ReplyReportUpdateRequest() {
}

0 comments on commit bf92f45

Please sign in to comment.