-
Notifications
You must be signed in to change notification settings - Fork 0
[BE-115] feat: 레코드 삭제 #114
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
Conversation
…inUserWithRecordWriterException
| @ApiOperation( | ||
| value = "레코드 단건 조회", | ||
| notes = "레코드를 단건 조회합니다." | ||
| ) | ||
| @ApiResponses({ | ||
| @ApiResponse( | ||
| code = 200, message = "레코드 조회 성공", | ||
| response = RecordDetailResponseDto.class | ||
| ), | ||
| @ApiResponse( | ||
| code = 400, message = "레코드가 없는 경우", | ||
| response = ErrorMessage.class | ||
| ) | ||
| }) |
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.
| @ApiOperation( | |
| value = "레코드 단건 조회", | |
| notes = "레코드를 단건 조회합니다." | |
| ) | |
| @ApiResponses({ | |
| @ApiResponse( | |
| code = 200, message = "레코드 조회 성공", | |
| response = RecordDetailResponseDto.class | |
| ), | |
| @ApiResponse( | |
| code = 400, message = "레코드가 없는 경우", | |
| response = ErrorMessage.class | |
| ) | |
| }) | |
| @ApiOperation( | |
| value = "레코드 단건 조회", | |
| notes = "레코드를 단건 조회합니다." | |
| ) | |
| @ApiResponses({ | |
| @ApiResponse( | |
| code = 200, message = "레코드 조회 성공", | |
| response = RecordDetailResponseDto.class | |
| ), | |
| @ApiResponse( | |
| code = 400, message = "레코드가 없는 경우", | |
| response = ErrorMessage.class | |
| ) | |
| }) |
삭제로 바꿔야 될듯용
| @Transactional | ||
| public WriteRecordResponseDto writeRecord(WriteRecordRequestDto writeRecordRequestDto, | ||
| List<MultipartFile> attachments) { | ||
| sessionUtil.saveUserIdInSession(1L); |
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.
지워야 될듯용
|
|
||
| @Transactional | ||
| public void deleteRecord(Long recordId) { | ||
| sessionUtil.saveUserIdInSession(1L); |
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.
여기도
| Member member = memberRepository.findById(userIdBySession) | ||
| .orElseThrow(() -> new MemberNotFoundException("회원 정보를 찾을 수 없습니다.")); | ||
|
|
||
| Record record = recordRepository.findByIdFetchWriter(recordId) | ||
| .orElseThrow(() -> new RecordNotFoundException("레코드 정보를 찾을 수 없습니다.")); | ||
|
|
||
| if (record.getWriter().getId() != member.getId()) { | ||
| throw new NotMatchLoginUserWithRecordWriterException("로그인 한 사용자와 글 작성자가 일치하지 않습니다."); | ||
| } |
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.
관련 테스트 코드도 작성해주세요
관련 이슈 번호
설명
레코드 삭제 API 구현
변경사항
질문사항