ums 연동 로컬 확인

This commit is contained in:
Rinjae
2025-11-05 18:54:15 +09:00
parent 6246a7beae
commit 8c4c9e4c32
5 changed files with 13 additions and 10 deletions
+1
View File
@@ -27,6 +27,7 @@ dependencies {
implementation project(':elink-online-core-jpa') implementation project(':elink-online-core-jpa')
implementation project(':elink-portal-common') implementation project(':elink-portal-common')
implementation project(':kjb-safedb')
implementation('org.springframework.boot:spring-boot-starter') implementation('org.springframework.boot:spring-boot-starter')
implementation 'org.springframework.boot:spring-boot-starter-jta-atomikos' implementation 'org.springframework.boot:spring-boot-starter-jta-atomikos'
@@ -1,6 +1,9 @@
package com.eactive.apim.portal.apps.auth.service; package com.eactive.apim.portal.apps.auth.service;
import com.eactive.apim.portal.portaluser.event.UserVerificationEmailEvent;
import com.eactive.apim.portal.portaluser.event.UserVerificationMobilePhoneEvent; import com.eactive.apim.portal.portaluser.event.UserVerificationMobilePhoneEvent;
import com.eactive.apim.portal.template.entity.MessageCode;
import com.eactive.apim.portal.template.service.MessageEventHandler;
import com.eactive.apim.portal.template.service.MessageHandlerService; import com.eactive.apim.portal.template.service.MessageHandlerService;
import com.eactive.apim.portal.template.service.MessageRecipient; import com.eactive.apim.portal.template.service.MessageRecipient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -31,15 +34,15 @@ public class MessageSender {
// 이메일, SMS MESSAEG_CODE 다름 처리 // 이메일, SMS MESSAEG_CODE 다름 처리
String messageCode = ""; MessageCode messageCode;
if ("email".equalsIgnoreCase(msgType)) { if ("email".equalsIgnoreCase(msgType)) {
messageCode = "USER_VERIFICATION_EMAIL"; messageCode = MessageCode.USER_VERIFICATION_EMAIL;
} else if ("sms".equalsIgnoreCase(msgType)) { } else if ("sms".equalsIgnoreCase(msgType)) {
messageCode = "USER_VERIFICATION_MOBILEPHONE"; messageCode = MessageCode.USER_VERIFICATION_MOBILEPHONE;
} else { } else {
throw new IllegalArgumentException("Unsupported message type: " + msgType); throw new IllegalArgumentException("Unsupported message type: " + msgType);
} }
messageHandlerService.publishEvent(UserVerificationMobilePhoneEvent.KEY, recipient, params); messageHandlerService.publishEvent(messageCode, recipient, params);
} }
} }
@@ -19,8 +19,8 @@ import com.eactive.apim.portal.file.service.FileTypeContext;
import com.eactive.apim.portal.portalorg.entity.PortalOrg; import com.eactive.apim.portal.portalorg.entity.PortalOrg;
import com.eactive.apim.portal.portaluser.entity.PortalUser; import com.eactive.apim.portal.portaluser.entity.PortalUser;
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums; import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
import com.eactive.apim.portal.portaluser.event.UserEmailActivationEvent;
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository; import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
import com.eactive.apim.portal.template.entity.MessageCode;
import com.eactive.apim.portal.template.service.MessageHandlerService; import com.eactive.apim.portal.template.service.MessageHandlerService;
import com.eactive.apim.portal.template.service.MessageRecipient; import com.eactive.apim.portal.template.service.MessageRecipient;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -206,7 +206,7 @@ public class OrgRegisterFacadeImpl implements OrgRegisterFacade {
try { try {
String encToken = encryptionUtil.encrypt(tokenValue); String encToken = encryptionUtil.encrypt(tokenValue);
params.put("token", Base64.encode(encToken.getBytes(StandardCharsets.UTF_8))); params.put("token", Base64.encode(encToken.getBytes(StandardCharsets.UTF_8)));
messageHandlerService.publishEvent(UserEmailActivationEvent.KEY, recipient, params); messageHandlerService.publishEvent(MessageCode.USER_VERIFICATION_EMAIL, recipient, params);
} catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) { } catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
throw new SystemException("암호화 모듈 오류"); throw new SystemException("암호화 모듈 오류");
} }
@@ -16,8 +16,8 @@ import com.eactive.apim.portal.invitation.entity.UserInvitation;
import com.eactive.apim.portal.invitation.entity.UserInvitationEnums; import com.eactive.apim.portal.invitation.entity.UserInvitationEnums;
import com.eactive.apim.portal.invitation.repository.UserInvitationRepository; import com.eactive.apim.portal.invitation.repository.UserInvitationRepository;
import com.eactive.apim.portal.portaluser.entity.PortalUser; import com.eactive.apim.portal.portaluser.entity.PortalUser;
import com.eactive.apim.portal.portaluser.event.UserEmailActivationEvent;
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository; import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
import com.eactive.apim.portal.template.entity.MessageCode;
import com.eactive.apim.portal.template.service.MessageHandlerService; import com.eactive.apim.portal.template.service.MessageHandlerService;
import com.eactive.apim.portal.template.service.MessageRecipient; import com.eactive.apim.portal.template.service.MessageRecipient;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -219,7 +219,7 @@ public class UserRegisterFacadeImpl implements UserRegisterFacade {
String tokenValue = String.valueOf(authNumberGenerator.generateAuthNumber()); String tokenValue = String.valueOf(authNumberGenerator.generateAuthNumber());
// String tokenValue = registeredUser.getCreatedDate().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + ":" + registeredUser.getId(); // String tokenValue = registeredUser.getCreatedDate().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + ":" + registeredUser.getId();
params.put("token", tokenValue); params.put("token", tokenValue);
messageHandlerService.publishEvent(UserEmailActivationEvent.KEY, recipient, params); messageHandlerService.publishEvent(MessageCode.USER_VERIFICATION_EMAIL, recipient, params);
// try { // try {
// String encToken = encryptionUtil.encrypt(tokenValue); // String encToken = encryptionUtil.encrypt(tokenValue);
@@ -11,7 +11,6 @@ import com.eactive.apim.portal.config.PortalProperties;
import com.eactive.apim.portal.portaluser.entity.PortalUser; import com.eactive.apim.portal.portaluser.entity.PortalUser;
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums; import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums.RoleCode; import com.eactive.apim.portal.portaluser.entity.PortalUserEnums.RoleCode;
import com.eactive.apim.portal.portaluser.event.UserEmailActivationEvent;
import com.eactive.apim.portal.portaluser.event.UserPasswordResetEvent; import com.eactive.apim.portal.portaluser.event.UserPasswordResetEvent;
import com.eactive.apim.portal.portaluser.repository.PortalUserRepository; import com.eactive.apim.portal.portaluser.repository.PortalUserRepository;
import com.eactive.apim.portal.template.entity.MessageCode; import com.eactive.apim.portal.template.entity.MessageCode;
@@ -134,7 +133,7 @@ public class PortalUserAuthService implements UserDetailsService {
String encToken = encryptionUtil.encrypt(tokenValue); String encToken = encryptionUtil.encrypt(tokenValue);
params.put("token", Base64.encode(encToken.getBytes(StandardCharsets.UTF_8))); params.put("token", Base64.encode(encToken.getBytes(StandardCharsets.UTF_8)));
MessageRecipient recipient = createMessageRecipient(user); MessageRecipient recipient = createMessageRecipient(user);
messageHandlerService.publishEvent(UserEmailActivationEvent.KEY, recipient, params); messageHandlerService.publishEvent(MessageCode.USER_VERIFICATION_EMAIL, recipient, params);
} catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) { } catch (NoSuchPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
throw new SystemException("암호화 모듈 오류"); throw new SystemException("암호화 모듈 오류");
} }