Merge branch 'devs/ums' into jenkins_with_weblogic
This commit is contained in:
+1
-2
@@ -79,8 +79,7 @@ dependencies {
|
||||
api "org.mapstruct:mapstruct:1.5.5.Final", "org.projectlombok:lombok:1.18.28"
|
||||
|
||||
// project > properties > Java Compiler > Annoation Processing
|
||||
annotationProcessor "org.projectlombok:lombok:1.18.28", "org.projectlombok:lombok-mapstruct-binding:0.2.0", "org.mapstruct:mapstruct-processor:1.5.5.Final"
|
||||
annotationProcessor "com.querydsl:querydsl-apt:${queryDslVersion}:jpa", "jakarta.persistence:jakarta.persistence-api:2.2.3", "jakarta.annotation:jakarta.annotation-api:1.3.5"
|
||||
annotationProcessor "org.projectlombok:lombok:1.18.28", "org.projectlombok:lombok-mapstruct-binding:0.2.0", "org.mapstruct:mapstruct-processor:1.5.5.Final", "com.querydsl:querydsl-apt:${queryDslVersion}:jpa", "jakarta.persistence:jakarta.persistence-api:2.2.3", "jakarta.annotation:jakarta.annotation-api:1.3.5"
|
||||
|
||||
// implementation files(rootProject.file('libs/elink-common-data-4.5.jar'));
|
||||
implementation 'com.eactive.elink.common:elink-common-data:4.5.5'
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.eactive.apim.portal.invitation.event;
|
||||
|
||||
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;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class UserInvitationCancelEvent implements MessageEventHandler {
|
||||
// public static final String KEY = "USER_INVITATION";
|
||||
public static final MessageCode KEY = MessageCode.USER_INVITATION_CANCELED;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean allowAdditionalRecipients() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageSendEvent createEvent(Object source, MessageRecipient recipient, Map<String, Object> params) {
|
||||
Map<String, String> requestParams = new HashMap<>();
|
||||
requestParams.put("corpName", params.get("corpName").toString());
|
||||
requestParams.put("managerName", params.get("managerName").toString());
|
||||
return new MessageSendEvent(source, KEY, recipient, requestParams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageCode getKey() {
|
||||
return KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return "이메일 사용자 초대";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
/*
|
||||
{"CRPT_NM":"%corpName%","MNGR_NM":"%managerName%"}
|
||||
*/
|
||||
return "<div>사용 가능 변수: </div><br/>"
|
||||
+ "<div> - corpName: 회사명 </div><br/>"
|
||||
+ "<div> - managerName: 초대 담당자명 </div><br/>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.eactive.apim.portal.portaluser.event;
|
||||
|
||||
|
||||
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;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class UserAccountLockedEvent implements MessageEventHandler {
|
||||
|
||||
public static final MessageCode KEY = MessageCode.USER_ACCOUNT_LOCKED;
|
||||
|
||||
@Override
|
||||
public boolean allowAdditionalRecipients() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageSendEvent createEvent(Object source, MessageRecipient recipient, Map<String, Object> params) {
|
||||
Map<String, String> requestParams = new HashMap<>();
|
||||
if (params.containsKey("reason")) {
|
||||
requestParams.put("reason", String.valueOf(params.get("reason")));
|
||||
}
|
||||
return new MessageSendEvent(source, KEY, recipient, requestParams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageCode getKey() {
|
||||
return KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return "계정 잠김 알림";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "<div>사용 가능 변수: </div><br/>"
|
||||
+ "<div> - reason 거부 사유 </div><br/>";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public enum MessageCode {
|
||||
|
||||
// 법인관리자 이벤트 영역
|
||||
USER_INVITATION("법인 이용자 이메일 초대", "FM_APIM005", Channels.EMAIL),
|
||||
USER_INVICATION_CANCELED("법인 이용자 이메일 초대 취소", "FM_APIM006", Channels.EMAIL),
|
||||
USER_INVITATION_CANCELED("법인 이용자 이메일 초대 취소", "FM_APIM006", Channels.EMAIL),
|
||||
|
||||
MANAGER_WITH_ORG_REGISTER_APPROVED("법인관리자 및 법인 등록 승인", "FM_APIM007", Channels.EMAIL),
|
||||
MANAGER_WITH_ORG_REGISTER_REJECTED("법인관리자 및 법인 등록 거절", "FM_APIM008", Channels.EMAIL),
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@@ -41,9 +42,15 @@ public class MessageHandlerService {
|
||||
}
|
||||
|
||||
public void publishEvent(MessageCode key, MessageRecipient recipient, Map<String, Object> params) {
|
||||
MessageSendEvent event = handlers.get(key.name()).createEvent(this, recipient, params);
|
||||
MessageSendEvent event = handlers.get(key.name())
|
||||
.createEvent(this, recipient, params);
|
||||
eventPublisher.publishEvent(event);
|
||||
}
|
||||
|
||||
public void publishEvent(MessageCode key, MessageRecipient recipient) {
|
||||
publishEvent(key, recipient, new HashMap<>());
|
||||
}
|
||||
|
||||
public void publishEvent(MessageSendEvent event) {
|
||||
eventPublisher.publishEvent(event);
|
||||
}
|
||||
@@ -53,5 +60,4 @@ public class MessageHandlerService {
|
||||
// messageSendService.sendMessage(event.getMessageType(), event.getRecipient(), event.getParams());
|
||||
messageSendService.sendMessage(event.getMessageCode(), event.getRecipient(), event.getParams());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.eactive.apim.portal.template.service;
|
||||
|
||||
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
||||
import kjb.safedb.KjbNotRnnoJpaAttributeConverter;
|
||||
import lombok.*;
|
||||
|
||||
@@ -10,10 +11,19 @@ import javax.persistence.Convert;
|
||||
@EqualsAndHashCode
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class MessageRecipient {
|
||||
private String username;
|
||||
private String userId; //email
|
||||
private String phone;
|
||||
private String messengerId;
|
||||
|
||||
|
||||
public static MessageRecipient of(PortalUser user) {
|
||||
MessageRecipient recipient = new MessageRecipient();
|
||||
recipient.setUsername(user.getUserName());
|
||||
recipient.setUserId(user.getEmailAddr());
|
||||
recipient.setPhone(user.getPhoneNumber());
|
||||
return recipient;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +141,10 @@ public class MessageSendService {
|
||||
}
|
||||
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
if (entry == null || entry.getKey() == null || entry.getValue() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String key = "%" + entry.getKey() + "%";
|
||||
String value = entry.getValue().replace("$", "\\$");
|
||||
contents = contents.replaceAll(key, value);
|
||||
|
||||
Reference in New Issue
Block a user