diff --git a/WebContent/jsp/onl/apim/approval/portalAppApprovalManPopup.jsp b/WebContent/jsp/onl/apim/approval/portalAppApprovalManPopup.jsp index 03e3996..7483acd 100644 --- a/WebContent/jsp/onl/apim/approval/portalAppApprovalManPopup.jsp +++ b/WebContent/jsp/onl/apim/approval/portalAppApprovalManPopup.jsp @@ -300,6 +300,10 @@
Client 정보
+ + + + diff --git a/WebContent/jsp/onl/apim/approval/portalUserApprovalManPopup.jsp b/WebContent/jsp/onl/apim/approval/portalUserApprovalManPopup.jsp index 24427b3..101cfcc 100644 --- a/WebContent/jsp/onl/apim/approval/portalUserApprovalManPopup.jsp +++ b/WebContent/jsp/onl/apim/approval/portalUserApprovalManPopup.jsp @@ -392,15 +392,21 @@
사용자 정보
이름
+ + + + + + - - + + - - - - + + + + diff --git a/src/main/java/com/eactive/eai/rms/common/login/MainController.java b/src/main/java/com/eactive/eai/rms/common/login/MainController.java index af3239e..bff4fae 100644 --- a/src/main/java/com/eactive/eai/rms/common/login/MainController.java +++ b/src/main/java/com/eactive/eai/rms/common/login/MainController.java @@ -73,7 +73,8 @@ public class MainController implements InterceptorSkipController { private final LoginService loginService; private final MonitoringPropertyService monitoringPropertyService; private final UserLoginHistoryService userLoginHistoryService; - + private final SmsAuthService smsAuthService; + @Autowired public MainController(LocaleMessage localeMessage, MonitoringContext monitoringContext, @@ -82,7 +83,8 @@ public class MainController implements InterceptorSkipController { UserRoleService userRoleService, UserServiceTypeService userServiceTypeService, MonitoringPropertyService monitoringPropertyService, - UserLoginHistoryService userLoginHistoryService) { + UserLoginHistoryService userLoginHistoryService, + SmsAuthService smsAuthService) { this.localeMessage = localeMessage; this.monitoringContext = monitoringContext; this.userInfoService = userInfoService; @@ -91,6 +93,7 @@ public class MainController implements InterceptorSkipController { this.userServiceTypeService = userServiceTypeService; this.monitoringPropertyService = monitoringPropertyService; this.userLoginHistoryService = userLoginHistoryService; + this.smsAuthService = smsAuthService; } @RequestMapping(value = "/loginForm.do") @@ -264,16 +267,8 @@ public class MainController implements InterceptorSkipController { } } - /** - * SmsAuthService 인스턴스 조회 (singleton) - */ private SmsAuthService getSmsAuthService() { - try { - return SmsAuthService.getInstance(); - } catch (Exception e) { - logger.warn("SmsAuthService 초기화 실패 - SMS 인증 비활성화 처리", e); - return null; - } + return smsAuthService; } /** diff --git a/src/main/java/com/eactive/eai/rms/ext/djb/ums/event/AdminVerificationMobilePhoneEventHandler.java b/src/main/java/com/eactive/eai/rms/ext/djb/ums/event/AdminVerificationMobilePhoneEventHandler.java new file mode 100644 index 0000000..c2ecbf2 --- /dev/null +++ b/src/main/java/com/eactive/eai/rms/ext/djb/ums/event/AdminVerificationMobilePhoneEventHandler.java @@ -0,0 +1,47 @@ +package com.eactive.eai.rms.ext.djb.ums.event; + +import java.util.HashMap; +import java.util.Map; + +import org.springframework.stereotype.Component; + +import com.eactive.apim.portal.template.entity.MessageCode; +import com.eactive.apim.portal.template.service.MessageEventHandler; +import com.eactive.apim.portal.template.service.MessageRecipient; +import com.eactive.apim.portal.template.service.MessageSendEvent; + +@Component +public class AdminVerificationMobilePhoneEventHandler implements MessageEventHandler { + + @Override + public MessageCode getKey() { + return MessageCode.ADMIN_VERIFICATION_MOBILEPHONE; + } + + @Override + public boolean allowAdditionalRecipients() { + return false; + } + + @Override + public String getDisplayName() { + return "관리자포탈 휴대폰 인증번호 발송"; + } + + @Override + public String getDescription() { + return "
사용 가능 변수:

" + + "
- userName 수신자 이름

" + + "
- authNumber 인증번호

"; + } + + @Override + public MessageSendEvent createEvent(Object source, MessageRecipient recipient, Map params) { + Map eventParams = new HashMap<>(); + String authNumber = (String) params.get("authNumber"); + eventParams.put("authNumber", authNumber); + eventParams.put("AUTH_CODE", authNumber); + eventParams.put("userName", (String) params.get("userName")); + return new MessageSendEvent(source, MessageCode.ADMIN_VERIFICATION_MOBILEPHONE, recipient, eventParams); + } +} diff --git a/src/main/java/com/eactive/eai/rms/ext/kjb/smsauth/SmsAuthController.java b/src/main/java/com/eactive/eai/rms/ext/kjb/smsauth/SmsAuthController.java index 32dab23..73aa5ba 100644 --- a/src/main/java/com/eactive/eai/rms/ext/kjb/smsauth/SmsAuthController.java +++ b/src/main/java/com/eactive/eai/rms/ext/kjb/smsauth/SmsAuthController.java @@ -20,13 +20,15 @@ import javax.servlet.http.HttpSession; public class SmsAuthController implements InterceptorSkipController { private final MainController mainController; + private final SmsAuthService smsAuthService; - public SmsAuthController(MainController mainController) { + public SmsAuthController(MainController mainController, SmsAuthService smsAuthService) { this.mainController = mainController; + this.smsAuthService = smsAuthService; } private SmsAuthService getSmsAuthService() { - return SmsAuthService.getInstance(); + return smsAuthService; } /** diff --git a/src/main/java/com/eactive/eai/rms/ext/kjb/smsauth/SmsAuthService.java b/src/main/java/com/eactive/eai/rms/ext/kjb/smsauth/SmsAuthService.java index 762dbf9..187784e 100644 --- a/src/main/java/com/eactive/eai/rms/ext/kjb/smsauth/SmsAuthService.java +++ b/src/main/java/com/eactive/eai/rms/ext/kjb/smsauth/SmsAuthService.java @@ -8,7 +8,7 @@ import java.util.HashMap; import javax.servlet.http.HttpSession; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import com.eactive.apim.portal.template.entity.MessageCode; import com.eactive.apim.portal.user.entity.UserInfo; @@ -19,11 +19,13 @@ import com.eactive.ext.kjb.common.KjbPropertyHolder; import com.eactive.ext.kjb.common.KjbUmsException; import com.eactive.ext.kjb.ums.KjbUmsService; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @Slf4j +@Service +@RequiredArgsConstructor public class SmsAuthService { - private static volatile SmsAuthService instance; // 세션 키 public static final String SESSION_KEY_AUTH_CODE = "SMS_AUTH_CODE"; @@ -41,24 +43,8 @@ public class SmsAuthService { public static final String MODE_FIXED = "fixed"; private final SecureRandom random = new SecureRandom(); - - @Autowired - private UmsManager ums; - private SmsAuthService() { - // 싱글톤 - } - - public static SmsAuthService getInstance() { - if (instance == null) { - synchronized (SmsAuthService.class) { - if (instance == null) { - instance = new SmsAuthService(); - } - } - } - return instance; - } + private final UmsManager ums; private static KjbProperty getProperty() { return KjbPropertyHolder.get(); @@ -124,22 +110,11 @@ public class SmsAuthService { */ public boolean sendAuthCode(UserInfo userInfo, String authCode) { try { -// String cleanedPhone = phone.replaceAll("[^0-9]", "").trim(); -// String guid = String.format("EAPIM_EMS-%s", -// DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS").format(LocalDateTime.now())); -// -// JsonObject content = GsonUtil.toJsonObject(VerifyPhoneUmsTemplate.builder().authNumber(authCode).build()); -// -// getUmsService().sendKakaoAlimTalk(guid, UmsBizWorkCode.VERIFY_PHONE, cleanedPhone, content); -// log.info("SMS 인증번호 발송 완료 - guid: {}, phone: {}****{}", -// guid, cleanedPhone.substring(0, 3), cleanedPhone.substring(cleanedPhone.length() - 4)); -// log.debug("SMS 인증번호 발송 - authCode: {}", authCode); - HashMap params = new HashMap(); params.put("authNumber", authCode); params.put("userName", userInfo.getUsername()); - - ums.send(userInfo, MessageCode.ADMIN_VERIFICATION_MOBILEPHONE, params); +log.debug("\n\n\nDDDDDDDDD" + userInfo.toString()); + ums.send(userInfo, MessageCode.ADMIN_VERIFICATION_MOBILEPHONE, params); return true; } catch (Exception e) { log.error("SMS 인증번호 발송 실패", e); @@ -295,11 +270,4 @@ public class SmsAuthService { public boolean isEnabled() { return getProperty().isSmsAuthEnabled(); } - - /** - * 테스트용 인스턴스 리셋 - */ - public static void resetForTest() { - instance = null; - } }
이메일 아이디이메일 아이디
이름권한이름권한
핸드폰 번호