Skip to content

Commit

Permalink
feat: 가입자 수 카운팅 기능 추가 & event publisher 의존성 변경 (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
SunwoongH committed Apr 19, 2024
1 parent 6018496 commit 9ec0496
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@
import org.doorip.auth.jwt.JwtProvider;
import org.doorip.auth.jwt.JwtValidator;
import org.doorip.auth.jwt.Token;
import org.doorip.event.SignUpEvent;
import org.doorip.exception.ConflictException;
import org.doorip.exception.EntityNotFoundException;
import org.doorip.exception.InvalidValueException;
import org.doorip.exception.UnauthorizedException;
import org.doorip.message.ErrorMessage;
import org.doorip.message.EventMessage;
import org.doorip.openfeign.apple.AppleOAuthProvider;
import org.doorip.openfeign.discord.DiscordMessageProvider;
import org.doorip.openfeign.kakao.KakaoOAuthProvider;
import org.doorip.publisher.EventPublisher;
import org.doorip.user.domain.*;
import org.doorip.user.dto.request.ResultUpdateRequest;
import org.doorip.user.dto.request.UserReissueRequest;
import org.doorip.user.dto.request.UserSignInRequest;
import org.doorip.user.dto.request.UserSignUpRequest;
import org.doorip.user.dto.request.ProfileUpdateRequest;
import org.doorip.user.dto.request.*;
import org.doorip.user.dto.response.ProfileGetResponse;
import org.doorip.user.dto.response.UserSignInResponse;
import org.doorip.user.dto.response.UserSignUpResponse;
Expand Down Expand Up @@ -46,7 +43,7 @@ public class UserService {
private final JwtValidator jwtValidator;
private final AppleOAuthProvider appleOAuthProvider;
private final KakaoOAuthProvider kakaoOAuthProvider;
private final DiscordMessageProvider discordMessageProvider;
private final EventPublisher eventPublisher;

@Transactional(readOnly = true)
public void splash(Long userId) {
Expand All @@ -71,7 +68,8 @@ public UserSignUpResponse signUp(String token, UserSignUpRequest request) {
User savedUser = saveUser(request, platformId, enumPlatform);
Token issueToken = jwtProvider.issueToken(savedUser.getId());
updateRefreshToken(issueToken.refreshToken(), savedUser);
discordMessageProvider.sendMessage(EventMessage.SIGN_UP_EVENT);
int userCount = userRepository.countUser();
eventPublisher.publishSignUpEvent(SignUpEvent.of(EventMessage.SIGN_UP_EVENT, savedUser.getName(), userCount));
return UserSignUpResponse.of(issueToken, savedUser.getId());
}

Expand Down

0 comments on commit 9ec0496

Please sign in to comment.