-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: 방/회원/인증 신고 기능 추가 #158
Merged
+623
−27
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e39e7f1
test: 삭제된 회원 조회 테스트 추가
parksey 0e339ff
refactor: 회원 조회 변경
parksey 3c10ab6
feat: 신고 기능 추가 및 테스트 코드 추가
parksey cfec3f8
refactor: 신고 기능 로직 수정 및 테스트 코드 추가
parksey e9679dd
feat: 신고 api 기능 추가 및 테스트 코드 추가
parksey b2ba6eb
fix: 통합 테스트간 데이터 중복 및 index 문제 해결
parksey 35ab8d4
refactor: CsvSource null 부분 변경
parksey d781652
Merge branch 'develop' of https://github.com/team-moabam/moabam-BE in…
parksey 7b5bfba
Merge branch 'develop' of https://github.com/team-moabam/moabam-BE in…
parksey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: 신고 기능 로직 수정 및 테스트 코드 추가
commit cfec3f81faf9f09bc5c063e230cb74e9ca4d92b4
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,12 +32,24 @@ public class ReportService { | |
@Transactional | ||
public void report(AuthMember authMember, ReportRequest reportRequest) { | ||
validateNoReportSubject(reportRequest.roomId(), reportRequest.certificationId()); | ||
Report report = createReport(authMember.id(), reportRequest); | ||
reportRepository.save(report); | ||
} | ||
|
||
private Report createReport(Long reporterId, ReportRequest reportRequest) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. R: 네이밍 수정쫌... create에 찌들어버렸어 ,, |
||
Member reportedMember = memberService.findMember(reportRequest.reportedId()); | ||
|
||
if (nonNull(reportRequest.certificationId())) { | ||
Certification certification = certificationService.findCertification(reportRequest.certificationId()); | ||
|
||
return ReportMapper.toReport(reporterId, reportedMember.getId(), | ||
null, certification, reportRequest.description()); | ||
} | ||
|
||
Room room = roomService.findRoom(reportRequest.roomId()); | ||
Certification certification = certificationService.findCertification(reportRequest.certificationId()); | ||
Report report = ReportMapper.toReport(authMember.id(), reportedMember.getId(), | ||
room, certification, reportRequest.description()); | ||
reportRepository.save(report); | ||
|
||
return ReportMapper.toReport(reporterId, reportedMember.getId(), | ||
room, null, reportRequest.description()); | ||
} | ||
|
||
private void validateNoReportSubject(Long roomId, Long certificationId) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: report, createReport는 어떤 기능을 하는 서비스인가요?