-
Notifications
You must be signed in to change notification settings - Fork 2
[FEAT] 인증문자 발송 작업 #8
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
Open
dksgyrud1349
wants to merge
1
commit into
T-BluePot:dev
Choose a base branch
from
dksgyrud1349:feat/send-approval-sms
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+145
−32
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/main/java/com/barogagi/member/join/dto/UserIdCheckDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.barogagi.sendSms.dto; | ||
|
|
||
| import com.barogagi.config.vo.DefaultVO; | ||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| public class SendSmsVO extends DefaultVO { | ||
| private String recipientTel = ""; | ||
| private String messageContent = ""; | ||
| } |
62 changes: 62 additions & 0 deletions
62
src/main/java/com/barogagi/sendSms/service/SendSmsService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| package com.barogagi.sendSms.service; | ||
|
|
||
| import com.barogagi.sendSms.dto.SendSmsVO; | ||
| import net.nurigo.sdk.NurigoApp; | ||
| import net.nurigo.sdk.message.exception.NurigoMessageNotReceivedException; | ||
| import net.nurigo.sdk.message.model.Message; | ||
| import net.nurigo.sdk.message.service.DefaultMessageService; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
| import org.springframework.core.env.Environment; | ||
| import org.springframework.stereotype.Service; | ||
|
|
||
| @Service | ||
| public class SendSmsService { | ||
|
|
||
| private static final Logger logger = LoggerFactory.getLogger(SendSmsService.class); | ||
|
|
||
| private String SEND_TEL = ""; | ||
| private String API_KEY = ""; | ||
| private String API_SECRET_KEY = ""; | ||
|
|
||
| public SendSmsService(Environment environment) { | ||
| this.SEND_TEL = environment.getProperty("send.sms.tel"); | ||
| this.API_KEY = environment.getProperty("send.sms.api-key"); | ||
| this.API_SECRET_KEY = environment.getProperty("send.sms.api-secret-key"); | ||
| } | ||
|
|
||
| /** | ||
| * SMS 발송 | ||
| * @param sendSmsVO | ||
| * @return boolean | ||
| */ | ||
| public boolean sendSms(SendSmsVO sendSmsVO){ | ||
|
|
||
| boolean result = true; | ||
|
|
||
| DefaultMessageService messageService = NurigoApp.INSTANCE.initialize(API_KEY, API_SECRET_KEY, "https://api.solapi.com"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion API URL을 설정 가능하도록 외부화하세요. 하드코딩된 API URL을 application.properties로 이동시켜 환경별 설정이 가능하도록 해야 합니다. - DefaultMessageService messageService = NurigoApp.INSTANCE.initialize(API_KEY, API_SECRET_KEY, "https://api.solapi.com");
+ String apiUrl = environment.getProperty("send.sms.api-url", "https://api.solapi.com");
+ DefaultMessageService messageService = NurigoApp.INSTANCE.initialize(API_KEY, API_SECRET_KEY, apiUrl);
🤖 Prompt for AI Agents |
||
| // Message 패키지가 중복될 경우 net.nurigo.sdk.message.model.Message로 치환하여 주세요 | ||
| Message message = new Message(); | ||
| message.setFrom(SEND_TEL); | ||
| message.setTo(sendSmsVO.getRecipientTel()); | ||
| message.setText(sendSmsVO.getMessageContent()); | ||
|
|
||
| try { | ||
| // send 메소드로 ArrayList<Message> 객체를 넣어도 동작합니다! | ||
| messageService.send(message); | ||
| result = true; | ||
|
|
||
| } catch (NurigoMessageNotReceivedException exception) { | ||
| // 발송에 실패한 메시지 목록을 확인할 수 있습니다! | ||
| logger.info("발송에 실패한 메시지 목록: {}", exception.getFailedMessageList()); | ||
| logger.error(exception.getMessage()); | ||
| result = false; | ||
|
|
||
| } catch (Exception exception) { | ||
| logger.error(exception.getMessage()); | ||
| result = false; | ||
| } | ||
|
|
||
| return result; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
💡 Verification agent
🧩 Analysis chain
매퍼 스캔 패턴 변경에 대한 검증 필요
@MapperScan 설정을 전체 패키지(
com.barogagi)에서 특정 매퍼 패키지(com.barogagi.**.mapper)로 제한하는 것은 성능상 이점이 있지만, 기존 매퍼들이 새로운 패턴에 맞는 위치에 있는지 확인이 필요합니다.또한 주석 처리된 코드는 제거하는 것이 좋습니다.
다음 스크립트를 실행하여 기존 매퍼 인터페이스들의 위치를 확인해 주세요:
🏁 Script executed:
Length of output: 1852
매퍼 스캔 설정 검증 완료 및 주석 코드 제거 제안
새로 지정한
basePackages = "com.barogagi.**.mapper"패턴이 프로젝트 내 모든 Mapper 인터페이스를 정확히 포함함을 확인했습니다. 스캔 범위 변경으로 인한 누락 이슈는 없습니다.아래처럼 이전 주석 처리된 설정만 삭제해 주세요.
- //@MapperScan("com.barogagi") @MapperScan(basePackages = "com.barogagi.**.mapper") // MyBatis 매퍼만 있는 경로로 제한📝 Committable suggestion
🤖 Prompt for AI Agents