-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#31] Telegram Bot 기본 연동 및 회원가입 기능 구현 #32
Conversation
|
|
||
// 사용자의 이메일을 받아 OTP를 생성 후 텔레그램으로 전송 | ||
@PostMapping("/request-otp") | ||
public String requestOtp(@RequestBody Map<String, String> request) { |
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.
리턴 타입을 전부 동일하게 맞추는 것이 좋을 것 같습니다. 그래서 이 메소드도 클래스로 감싸서 결과를 내보내면 좋을 것 같네요.
private String password; | ||
|
||
private Long telegramChatId; | ||
private String otpHash; |
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.
이 필드는 일회용일테니, 필요하다면, 캐쉬같은 곳에 저장하면 좋을 것 같네요.
} | ||
|
||
@Override | ||
public void onUpdateReceived(Update update) { |
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.
멀티 인스턴스 환경에서 어떻게 동작하는지 확인해보시면 좋을 것 같아요.
private final UserService userService; | ||
private final TelegramBotProperties telegramBotProperties; | ||
|
||
private Map<Long, RegistrationData> registrationDataMap = new HashMap<>(); |
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.
다중 인스턴스 환경에 맞춰서 이 내용은 DB에 저장해야하지 않을까요? 혹은 캐쉬에 저장하거나
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.
멀티인스턴스에 대한 고민이 필요해보이지만, 로직은 잘 작성하신 것 같습니다. 👍
Telegram Bot 기본 연동 및 회원가입 기능 구현