Skip to content

Commit

Permalink
feat: 신고 시나리오에 content type 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoiWonYu committed Oct 13, 2024
1 parent d5d4e59 commit be05af0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public MemberReportResponse reportMember(final Long reportedContentId,
UUID reporterId = AuthUtil.getId();
Member reporter = memberService.findById(reporterId);
MemberReport memberReport = MemberReport.reportContent(request.reason(), reporter,
reportedContentId);
reportRepository.save(memberReport);
return MemberReportResponse.toDto(reportedContentId, request.reason());
reportedContentId, request.contentType());
MemberReport savedReport = reportRepository.save(memberReport);
return MemberReportResponse.toDto(savedReport.getReportedContentId(),
savedReport.getContentType(), savedReport.getReason());
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package com.first.flash.account.member.application.dto;

import com.first.flash.account.member.domain.ContentType;
import com.first.flash.global.annotation.ValidEnum;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;

public record MemberReportRequest(@NotEmpty(message = "신고 사유는 필수입니다.") String reason) {
public record MemberReportRequest(@NotEmpty(message = "신고 사유는 필수입니다.") String reason,
@NotNull(message = "콘텐츠 타입은 필수입니다.") @ValidEnum(enumClass = ContentType.class) ContentType contentType) {

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.first.flash.account.member.application.dto;

public record MemberReportResponse(Long reportedContentId, String reason) {
import com.first.flash.account.member.domain.ContentType;

public static MemberReportResponse toDto(final Long reportedContentId, final String reason) {
return new MemberReportResponse(reportedContentId, reason);
public record MemberReportResponse(Long reportedContentId, String contentType, String reason) {

public static MemberReportResponse toDto(final Long reportedContentId,
final ContentType contentType, final String reason) {
return new MemberReportResponse(reportedContentId, contentType.name(), reason);
}
}

0 comments on commit be05af0

Please sign in to comment.