Skip to content

Commit

Permalink
Merge pull request #241 from kookmin-sw/hotfix
Browse files Browse the repository at this point in the history
[chore] 불필요한 함수 제거
  • Loading branch information
tmdtmdqorekf authored May 15, 2024
2 parents fff8bf6 + ff258a9 commit 4e5bdff
Showing 1 changed file with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,26 +230,15 @@ private void validateLock(String lockKey) {
// 유저 검증
private void validateRequest(MatchRequestDto dto) {
// 본인에게 요청을 보내는 경우 처리 X
if (dto.getSenderId().equals(dto.getReceiverId())) {
throw new CustomException(ErrorCode.REQUEST_SAME_USER);
}
// if (dto.getSenderId().equals(dto.getReceiverId())) {
// throw new CustomException(ErrorCode.REQUEST_SAME_USER);
// }
// 유저 DB에 없는 유저가 보낼 경우 처리 X
if (!userRepository.existsById(dto.getSenderId())) {
throw new CustomException(ErrorCode.USER_NOT_FOUND);
}
}

// 매칭 정보 생성
private Map<String, String> createMatchInfo(MatchRequestDto dto, String matchId) {
return Map.of(
"matchId", matchId,
"senderId", dto.getSenderId().toString(),
"receiverId", dto.getReceiverId().toString(),
"requestTypeId", dto.getRequestTypeId(),
"status", "pending"
);
}

// Object -> Long 타입 변환
private Long getLongId(Object result) {
log.trace("getLongId()");
Expand Down

0 comments on commit 4e5bdff

Please sign in to comment.