Q&A 이벤트 리팩토링
- InquiryCommentCreatedAdminEvent 삭제 및 경로 변경 - userName 정보 추가 및 description 업데이트 - inquirySubject 처리 로직 개선
This commit is contained in:
-54
@@ -1,54 +0,0 @@
|
|||||||
package com.eactive.apim.portal.djb.community.qna.comment.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 InquiryCommentCreatedAdminEvent implements MessageEventHandler {
|
|
||||||
|
|
||||||
public static final MessageCode KEY = MessageCode.INQUIRY_COMMENT_CREATED;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MessageCode getKey() {
|
|
||||||
return KEY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean allowAdditionalRecipients() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDisplayName() {
|
|
||||||
return "Q&A 댓글 등록 알림";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getDescription() {
|
|
||||||
return "<div>사용 가능 변수: </div><br/>"
|
|
||||||
+ "<div> - inquiryId: 문의 ID </div><br/>"
|
|
||||||
+ "<div> - inquirySubject: 문의 제목 </div><br/>"
|
|
||||||
+ "<div> - commentContent: 댓글 본문 </div><br/>"
|
|
||||||
+ "<div> - writerName: 작성자 이름 </div><br/>";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MessageSendEvent createEvent(Object source, MessageRecipient recipient, Map<String, Object> params) {
|
|
||||||
Map<String, String> requestParams = new HashMap<>();
|
|
||||||
requestParams.put("inquiryId", toStr(params.get("inquiryId")));
|
|
||||||
requestParams.put("inquirySubject", toStr(params.get("inquirySubject")));
|
|
||||||
requestParams.put("commentContent", toStr(params.get("commentContent")));
|
|
||||||
requestParams.put("writerName", toStr(params.get("writerName")));
|
|
||||||
return new MessageSendEvent(source, KEY, recipient, requestParams);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String toStr(Object value) {
|
|
||||||
return value == null ? "" : value.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user