Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a23f0f73f3 | |||
| f26210b71a | |||
| 284b843e30 |
+71
@@ -0,0 +1,71 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.incident.entity;
|
||||
|
||||
import com.eactive.apim.portal.common.entity.Auditable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "DJB_APISTATUS_INCIDENT")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DjbApistatusIncident extends Auditable {
|
||||
|
||||
@Id
|
||||
@SequenceGenerator(name = "seqDjbApistatusIncident",
|
||||
sequenceName = "SEQ_DJB_APISTATUS_INCIDENT", allocationSize = 1)
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqDjbApistatusIncident")
|
||||
@Column(name = "INCIDENT_ID", nullable = false)
|
||||
private Long incidentId;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "KIND", length = 20, nullable = false)
|
||||
private IncidentKind kind;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "STATE", length = 30)
|
||||
private IncidentState state;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "PREVIOUS_STATE", length = 30)
|
||||
private IncidentState previousState;
|
||||
|
||||
@Column(name = "TITLE", length = 500, nullable = false)
|
||||
private String title;
|
||||
|
||||
@Column(name = "SUMMARY", length = 2000)
|
||||
private String summary;
|
||||
|
||||
@Column(name = "STARTED_AT")
|
||||
private LocalDateTime startedAt;
|
||||
|
||||
@Column(name = "END_AT")
|
||||
private LocalDateTime endAt;
|
||||
|
||||
@Column(name = "DETECTED_BY", length = 30, nullable = false)
|
||||
private String detectedBy = "MANUAL";
|
||||
|
||||
@Column(name = "INTERFACE_ID", length = 200)
|
||||
private String interfaceId;
|
||||
|
||||
@Column(name = "NOTICE_ID", length = 36)
|
||||
private String noticeId;
|
||||
|
||||
@Column(name = "DRAFT_YN", length = 1, nullable = false)
|
||||
private String draftYn = "N";
|
||||
|
||||
@Column(name = "FIX_YN", length = 1, nullable = false)
|
||||
private String fixYn = "N";
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.incident.entity;
|
||||
|
||||
import com.eactive.apim.portal.common.entity.Auditable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.IdClass;
|
||||
import javax.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "DJB_APISTATUS_INCIDENT_API")
|
||||
@IdClass(DjbApistatusIncidentApiId.class)
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true)
|
||||
public class DjbApistatusIncidentApi extends Auditable {
|
||||
|
||||
@Id
|
||||
@EqualsAndHashCode.Include
|
||||
@Column(name = "INCIDENT_ID", nullable = false)
|
||||
private Long incidentId;
|
||||
|
||||
@Id
|
||||
@EqualsAndHashCode.Include
|
||||
@Column(name = "API_ID", length = 30, nullable = false)
|
||||
private String apiId;
|
||||
|
||||
@Column(name = "API_NAME", length = 200)
|
||||
private String apiName;
|
||||
|
||||
@Column(name = "RECOVERED_AT")
|
||||
private LocalDateTime recoveredAt;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.incident.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DjbApistatusIncidentApiId implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long incidentId;
|
||||
private String apiId;
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.incident.entity;
|
||||
|
||||
import com.eactive.apim.portal.common.entity.Auditable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "DJB_APISTATUS_INCIDENT_TIMELINE")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DjbApistatusIncidentTimeline extends Auditable {
|
||||
|
||||
@Id
|
||||
@SequenceGenerator(name = "seqDjbApistatusIncidentTimeline",
|
||||
sequenceName = "SEQ_DJB_APISTATUS_INCIDENT_TIMELINE", allocationSize = 1)
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqDjbApistatusIncidentTimeline")
|
||||
@Column(name = "TIMELINE_ID", nullable = false)
|
||||
private Long timelineId;
|
||||
|
||||
@Column(name = "INCIDENT_ID", nullable = false)
|
||||
private Long incidentId;
|
||||
|
||||
@Column(name = "EVENT_AT", nullable = false)
|
||||
private LocalDateTime eventAt;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "STATE_AFTER", length = 30)
|
||||
private IncidentState stateAfter;
|
||||
|
||||
@Column(name = "BODY", length = 4000, nullable = false)
|
||||
private String body;
|
||||
|
||||
@Column(name = "AUTHOR_TYPE", length = 20, nullable = false)
|
||||
private String authorType = "OPERATOR";
|
||||
|
||||
@Column(name = "VISIBLE_YN", length = 1, nullable = false)
|
||||
private String visibleYn = "Y";
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.incident.entity;
|
||||
|
||||
public enum IncidentKind {
|
||||
INCIDENT,
|
||||
MAINTENANCE
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.incident.entity;
|
||||
|
||||
public enum IncidentState {
|
||||
INVESTIGATING,
|
||||
IDENTIFIED,
|
||||
MONITORING,
|
||||
RESOLVED,
|
||||
CANCELED
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.incident.repository;
|
||||
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncidentApi;
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncidentApiId;
|
||||
import com.eactive.eai.rms.data.EMSDataSource;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@EMSDataSource
|
||||
public interface DjbApistatusIncidentApiRepository
|
||||
extends JpaRepository<DjbApistatusIncidentApi, DjbApistatusIncidentApiId> {
|
||||
|
||||
List<DjbApistatusIncidentApi> findByIncidentIdOrderByApiId(Long incidentId);
|
||||
|
||||
void deleteByIncidentId(Long incidentId);
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.incident.repository;
|
||||
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncident;
|
||||
import com.eactive.eai.rms.data.EMSDataSource;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
@EMSDataSource
|
||||
public interface DjbApistatusIncidentRepository
|
||||
extends JpaRepository<DjbApistatusIncident, Long>, JpaSpecificationExecutor<DjbApistatusIncident> {
|
||||
|
||||
Optional<DjbApistatusIncident> findByNoticeId(String noticeId);
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.eactive.apim.portal.djb.apistatus.incident.repository;
|
||||
|
||||
import com.eactive.apim.portal.djb.apistatus.incident.entity.DjbApistatusIncidentTimeline;
|
||||
import com.eactive.eai.rms.data.EMSDataSource;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
@EMSDataSource
|
||||
public interface DjbApistatusIncidentTimelineRepository
|
||||
extends JpaRepository<DjbApistatusIncidentTimeline, Long> {
|
||||
|
||||
List<DjbApistatusIncidentTimeline> findByIncidentIdOrderByEventAtAsc(Long incidentId);
|
||||
|
||||
void deleteByIncidentId(Long incidentId);
|
||||
}
|
||||
@@ -25,7 +25,6 @@ public enum MessageCode {
|
||||
MANAGER_WITH_ORG_REGISTER_APPROVED("법인관리자 및 법인 등록 승인", "FM_APIM007", Channels.EMAIL),
|
||||
MANAGER_WITH_ORG_REGISTER_REJECTED("법인관리자 및 법인 등록 거절", "FM_APIM008", Channels.EMAIL),
|
||||
|
||||
|
||||
// 관리자 영역
|
||||
APP_REGISTER_APPROVED("앱 등록 승인", "FM_APIM009", Channels.EMAIL),
|
||||
APP_REGISTER_REJECTED("앱 등록 거절", "FM_APIM010", Channels.EMAIL),
|
||||
@@ -34,11 +33,9 @@ public enum MessageCode {
|
||||
INQUIRY_CREATED("Q&A 등록 알림", null, Channels.NONE),
|
||||
INQUIRY_COMMENT_CREATED("Q&A 댓글 등록 알림", null, Channels.NONE),
|
||||
|
||||
|
||||
// API상태 모니터링
|
||||
API_STATUS_CHANGED("API 상태 변화", "FM_APIM011", Channels.MESSENGER),
|
||||
// 유량제어 토큰 획득 실패
|
||||
INFLOW_TOKEN_FAILED("유량제어 토큰 획득 실패", "FM_APIM012", Channels.MESSENGER),
|
||||
// 제주은행
|
||||
API_STATUS_CHANGED("API 상태 변화", "FM_APIM011", Channels.SWING),
|
||||
INFLOW_TOKEN_FAILED("유량제어 토큰 획득 실패", "FM_APIM012", Channels.SWING),
|
||||
|
||||
|
||||
// 미 사용, 미 분류
|
||||
@@ -122,7 +119,7 @@ public enum MessageCode {
|
||||
NONE (0b0000),
|
||||
EMAIL (0b0001),
|
||||
KAKAO_ALIMTALK (0b0010),
|
||||
MESSENGER (0b0100),
|
||||
SWING (0b0100),
|
||||
;
|
||||
|
||||
@Getter
|
||||
|
||||
@@ -66,7 +66,7 @@ public class MessageRequest implements Serializable {
|
||||
private PortalUser user;
|
||||
|
||||
@Comment("UMS 연계용 UID")
|
||||
@Column(name="ums_uid", length = 16)
|
||||
@Column(name="ums_uid", length = 36)
|
||||
private String umsUid;
|
||||
|
||||
@Column(name = "messenger_id")
|
||||
|
||||
@@ -78,7 +78,7 @@ public class MessageSendService {
|
||||
String subject = buildMessage(template.getSubjectTemplate(), messageParams);
|
||||
|
||||
if (template.getEnableSms().equalsIgnoreCase("Y")) {
|
||||
String smsEaiInterfaceId = portalProperties.get("message.integration.eaiId.sms");
|
||||
String smsEaiInterfaceId = portalProperties.get("ums.sms.if_id");
|
||||
MessageRequest smsRequest = new MessageRequest();
|
||||
smsRequest.setMessageCode(MessageCode.valueOf(template.getMessageCode().toUpperCase()));
|
||||
smsRequest.setSubject(subject);
|
||||
@@ -88,14 +88,14 @@ public class MessageSendService {
|
||||
smsRequest.setUsername(user.getUsername());
|
||||
smsRequest.setPhone(user.getPhone());
|
||||
smsRequest.setEaiInterfaceId(smsEaiInterfaceId);
|
||||
smsRequest.setServiceId(portalProperties.get("message.integration.template.sms." + template.getMessageCode()));
|
||||
smsRequest.setMessageType("KAKAO");
|
||||
smsRequest.setServiceId(portalProperties.get("ums.sms.tx_id"));
|
||||
smsRequest.setMessageType("SMS");
|
||||
messageRequestRepository.save(smsRequest);
|
||||
logger.debug(smsRequest.toString());
|
||||
}
|
||||
|
||||
if (template.getEnableEmail().equalsIgnoreCase("Y")) {
|
||||
String mailEaiInterfaceId = portalProperties.get("message.integration.eaiId.email");
|
||||
String mailEaiInterfaceId = portalProperties.get("ums.email.if_id");
|
||||
MessageRequest emailRequest = new MessageRequest();
|
||||
emailRequest.setMessageCode(MessageCode.valueOf(template.getMessageCode().toUpperCase()));
|
||||
emailRequest.setSubject(subject);
|
||||
@@ -105,13 +105,14 @@ public class MessageSendService {
|
||||
emailRequest.setUsername(user.getUsername());
|
||||
emailRequest.setEmail(user.getUserId());
|
||||
emailRequest.setEaiInterfaceId(mailEaiInterfaceId);
|
||||
emailRequest.setServiceId(portalProperties.get("message.integration.template.email." + template.getMessageCode()));
|
||||
emailRequest.setServiceId(portalProperties.get("ums.email.tx_id"));
|
||||
emailRequest.setMessageType("EMAIL");
|
||||
messageRequestRepository.save(emailRequest);
|
||||
logger.debug(emailRequest.toString());
|
||||
}
|
||||
|
||||
if (template.getEnableMessenger().equalsIgnoreCase("Y")) {
|
||||
String swingEaiInterfaceId = portalProperties.get("ums.messenger.if_id");
|
||||
MessageRequest messengerRequest = new MessageRequest();
|
||||
messengerRequest.setMessageCode(MessageCode.valueOf(template.getMessageCode()));
|
||||
messengerRequest.setSubject(subject);
|
||||
@@ -120,6 +121,9 @@ public class MessageSendService {
|
||||
messengerRequest.setRequestDate(LocalDateTime.now());
|
||||
messengerRequest.setUsername(user.getUsername());
|
||||
messengerRequest.setMessengerId(user.getUserId());
|
||||
messengerRequest.setEaiInterfaceId(swingEaiInterfaceId);
|
||||
messengerRequest.setServiceId(portalProperties.get("ums.messenger.tx_id"));
|
||||
messengerRequest.setMessageType("MESSENGER");
|
||||
messageRequestRepository.save(messengerRequest);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user