Skip to content

Commit

Permalink
feat: signup api에 탈퇴 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ksj000625 committed Nov 5, 2024
1 parent 932226b commit 4cfb33a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,10 @@ public class AuthServiceImpl implements AuthService {
@Transactional
public JwtDto signup(SignupRequest request) {
// Check new by name & phoneNumber
boolean isExists =
userIdentityRepository.existsByNameAndPhoneNumber(
request.getIdentity().getName(),
request.getIdentity().getPhoneNumber()
);
Optional<UserIdentityJpaEntity> identityJpaEntity = userIdentityRepository.findUserByPhoneNumberWithoutWithdraw(request.getIdentity().getPhoneNumber());

// if user already exists
if (isExists) {
if (identityJpaEntity.isPresent()) {
throw new CustomException(ErrorCode.Conflict, "이미 존재하는 회원입니다.", HttpStatus.CONFLICT);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@

@Repository
public interface UserIdentityRepository extends JpaRepository<UserIdentityJpaEntity, String>, UserIdentityDslRepository {
boolean existsByNameAndPhoneNumber(String name, String phoneNumber);

Optional<UserIdentityJpaEntity> findByPhoneNumber(String phoneNumber);
}

0 comments on commit 4cfb33a

Please sign in to comment.