first commit

This commit is contained in:
2026-01-09 14:13:05 +09:00
commit 9fd3911db8
79 changed files with 6568 additions and 0 deletions

View File

@@ -0,0 +1,99 @@
package com.kri.notihub.server.dto.report;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.kri.notihub.server.persistence.entity.TBulkSendEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import java.time.LocalDateTime;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "대량발송 정보")
public class BulkSendInfoDto {
@Size(max = 32)
@NotBlank
@Schema(description = "대량발송 키", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String bulkSendKey;
@Size(max = 16)
@NotBlank
@Schema(description = "요청 서비스")
private String reqstSvc;
@Size(max = 32)
@NotBlank
@Schema(description = "프로젝트 코드")
private String prjctCd;
@Schema(description = "템플릿 인덱스")
private Long tmplatIdx;
@NotNull
@Schema(description = "예약 여부")
private Boolean resve;
@NotNull
@Schema(description = "발송일시")
private LocalDateTime sendDt;
@NotNull
@Schema(description = "대상 건수")
private Integer trgtCnt;
@NotNull
@Schema(description = "발송 건수", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Integer sendCnt;
@NotNull
@Schema(description = "성공 건수", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Integer succesCnt;
@NotNull
@Schema(description = "실패 건수", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Integer failCnt;
@Schema(description = "완료일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime completeDt;
@Size(max = 32)
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String regUser;
@Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime regDt;
public static BulkSendInfoDto from(TBulkSendEntity entity) {
if (entity == null) return null;
return BulkSendInfoDto.builder()
.bulkSendKey(entity.getBulkSendKey())
.reqstSvc(entity.getReqstSvc())
.prjctCd(entity.getPrjctCd())
.tmplatIdx(entity.getTmplatIdx())
.resve(entity.getResve() != null ? entity.getResve() : Boolean.FALSE)
.sendDt(entity.getSendDt())
.trgtCnt(entity.getTrgtCnt())
.sendCnt(entity.getSendCnt())
.succesCnt(entity.getSuccesCnt())
.failCnt(entity.getFailCnt())
.completeDt(entity.getCompleteDt())
.regUser(entity.getRegUser())
.regDt(entity.getRegDt())
.build();
}
}

View File

@@ -0,0 +1,131 @@
package com.kri.notihub.server.dto.report;
import com.kri.notihub.server.common.enums.SendType;
import com.kri.notihub.server.persistence.entity.TSendEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import java.time.LocalDateTime;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "발송 정보")
public class SendInfoDto {
@Size(max = 32)
@NotBlank
@Schema(description = "CMID")
private String cmid;
@Size(max = 32)
@Schema(description = "대량발송 키")
private String bulkSendKey;
@NotNull
@Schema(description = "발송 타입 코드")
private Short sendTy;
@NotNull
@Schema(description = "예약 여부")
private Boolean resve;
@NotNull
@Schema(description = "발송 상태 코드")
private Short sendStatus;
@NotNull
@Schema(description = "결과 코드")
private Short resultCode;
@Size(max = 16)
@NotBlank
@Schema(description = "요청 서비스")
private String reqstSvc;
@Size(max = 32)
@NotBlank
@Schema(description = "프로젝트 코드")
private String prjctCd;
@Schema(description = "템플릿 인덱스")
private Long tmplatIdx;
@Size(max = 64)
@Schema(description = "발신지(EMAIL이면 sendEml, 아니면 sendTel)")
private String sendFrom;
@Size(max = 32)
@Schema(description = "발신자명")
private String sendNm;
@NotNull
@Schema(description = "발송 일시")
private LocalDateTime sendDt;
@Size(max = 128)
@NotBlank
@Schema(description = "SID")
private String sid;
@Size(max = 64)
@Schema(description = "수신지(EMAIL이면 destEml, 아니면 destTel)")
private String destTo;
@Size(max = 32)
@Schema(description = "수신자명")
private String destNm;
@Schema(description = "리포트 일시")
private LocalDateTime reportDt;
@Size(max = 32)
@NotBlank
@Schema(description = "등록 회사")
private String regCmpn;
@Size(max = 32)
@NotBlank
@Schema(description = "등록자")
private String regUser;
@NotNull
@Schema(description = "등록일시")
private LocalDateTime regDt;
public static SendInfoDto from(TSendEntity entity) {
if (entity == null) return null;
boolean isEmail = entity.getSendTy() != null
&& entity.getSendTy().equals(SendType.EMAIL.getCode());
String sendFrom = isEmail ? entity.getSendEml() : entity.getSendTel();
String destTo = isEmail ? entity.getDestEml() : entity.getDestTel();
return SendInfoDto.builder()
.cmid(entity.getCmid())
.bulkSendKey(entity.getBulkSendKey())
.sendTy(entity.getSendTy())
.resve(entity.isResve())
.sendStatus(entity.getSendStatus())
.resultCode(entity.getResultCode())
.reqstSvc(entity.getReqstSvc())
.prjctCd(entity.getPrjctCd())
.tmplatIdx(entity.getTmplatIdx())
.sendFrom(sendFrom)
.sendNm(entity.getSendNm())
.sendDt(entity.getSendDt())
.sid(entity.getSid())
.destTo(destTo)
.destNm(entity.getDestNm())
.reportDt(entity.getReportDt())
.regUser(entity.getRegUser())
.regDt(entity.getRegDt())
.build();
}
}

View File

@@ -0,0 +1,52 @@
package com.kri.notihub.server.dto.send;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import java.time.LocalDateTime;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BulkSendCreateRequestDto {
@NotBlank
@Schema(description = "발송 요청 서비스 (로그용)")
private String reqstSvc;
@Schema(description = "발송 요청 서비스의 프로젝트 코드 (로그용)")
private String prjctCd;
@NotNull
@Schema(description = "템플릿 idx")
private Long tmplatIdx;
@NotNull
@Builder.Default
@Schema(description = "예약 여부")
private Boolean resve = false;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "발송일시(미입력 시 현재 시간)")
private LocalDateTime sendDt;
@NotNull
@Schema(description = "대상자 수")
private Integer trgtCnt;
@Size(max = 32)
@NotBlank
@Schema(description = "발송 요청 회사")
String reqstCmpn;
@Size(max = 32)
@NotBlank
@Schema(description = "발송 요청자")
String reqstUser;
}

View File

@@ -0,0 +1,35 @@
package com.kri.notihub.server.dto.send;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BulkSendResponseDto {
@Schema(description = "bulkSendKey")
private String bulkSendKey;
@Schema(description = "요청 건수")
private Integer requestCount;
@Schema(description = "Pringo send 요청 성공(return_key 수신) 건수")
private Integer acceptCount;
@Schema(description = "Pringo send 요청 실패(return_key 미수신) 건수")
private Integer failCount;
public static BulkSendResponseDto of(String bulkSendKey, Integer requestCount, Integer acceptCount, Integer failCount) {
return BulkSendResponseDto.builder()
.bulkSendKey(bulkSendKey)
.requestCount(requestCount)
.acceptCount(acceptCount)
.failCount(failCount)
.build();
}
}

View File

@@ -0,0 +1,47 @@
package com.kri.notihub.server.dto.send;
import com.kri.notihub.server.persistence.entity.TSendEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Size;
import lombok.*;
import java.util.Map;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "수신 정보")
public class DestInfoDto {
@Schema(description = "리스트 아이디")
private String sid;
@Size(max = 64)
@Email
@Schema(description = "수신 이메일 (이메일 발송에서 사용)")
private String destEml;
@Size(max = 16)
@Schema(description = "수신 전화번호 (문자 발송에서 사용)")
private String destTel;
@Size(max = 32)
@Schema(description = "수신자 이름")
private String destNm;
@Schema(description = "수신 파라미터 (템플릿 내용 파싱용)")
private Map<String, String> msgParam;
public static DestInfoDto from(TSendEntity entity) {
return DestInfoDto.builder()
.sid(entity.getSid())
.destEml(entity.getDestEml())
.destTel(entity.getDestTel())
.destNm(entity.getDestNm())
.msgParam(entity.getMsgParam())
.build();
}
}

View File

@@ -0,0 +1,41 @@
package com.kri.notihub.server.dto.send;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kri.common.datetime.DateTimeUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.time.Instant;
import java.time.LocalDateTime;
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmailPollQueueItemDto {
@Schema(description = "Pringo return_key(cmid)")
private String cmid;
@Schema(description = "폴링 시도 횟수(0부터 시작)")
private Integer attempt;
@Schema(description = "구동까지 남은 시간(ms)")
private Long remainingMs;
@Schema(description = "구동 예상 시간(KST LocalDateTime)")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime triggerAt;
public static EmailPollQueueItemDto of(String cmid, int attempt, long remainingMs, long triggerAtEpochMs) {
return EmailPollQueueItemDto.builder()
.cmid(cmid)
.attempt(attempt)
.remainingMs(remainingMs)
.triggerAt(DateTimeUtil.toKstLocalDateTime(Instant.ofEpochMilli(triggerAtEpochMs)))
.build();
}
}

View File

@@ -0,0 +1,28 @@
package com.kri.notihub.server.dto.send;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import java.util.List;
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmailPollQueueResponseDto {
@Schema(description = "Queue size (snapshot)")
private Integer size;
@Schema(description = "Queue에 있는 작업 내용 (snapshot)")
private List<EmailPollQueueItemDto> items;
public static EmailPollQueueResponseDto of(List<EmailPollQueueItemDto> items) {
return EmailPollQueueResponseDto.builder()
.size(items != null ? items.size() : 0)
.items(items)
.build();
}
}

View File

@@ -0,0 +1,28 @@
package com.kri.notihub.server.dto.send;
import com.kri.notihub.server.common.enums.SendStatusType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "이메일/문자 발송 결과")
public class SendInternalResultDto {
private String cmid;
private SendStatusType status;
private Short resultCode;
public static SendInternalResultDto of(String cmid, SendStatusType status, short resultCode) {
return SendInternalResultDto.builder()
.cmid(cmid)
.status(status)
.resultCode(resultCode)
.build();
}
}

View File

@@ -0,0 +1,29 @@
package com.kri.notihub.server.dto.send;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "발송 기본 정보")
public class SendRequestBasicDto {
@Size(max = 64)
@Email
@Schema(description = "발신 이메일 (이메일 발송에만 사용)")
private String sendEml;
@Size(max = 16)
@Schema(description = "발신 전화번호 (문자 발송에만 사용)")
private String sendTel;
@Size(max = 32)
@Schema(description = "발신 이름")
private String sendNm;
}

View File

@@ -0,0 +1,23 @@
package com.kri.notihub.server.dto.send;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import java.util.List;
@Getter
@Setter
@Schema(description = "일괄 발송 요청 정보")
public class SendRequestBulkDto extends SendRequestBasicDto {
@Size(max = 32)
@NotBlank
@Schema(description = "일괄 발송 고유키")
String bulkSendKey;
@NotNull
@Schema(description = "수신자 정보")
List<DestInfoDto> destInfoList;
}

View File

@@ -0,0 +1,40 @@
package com.kri.notihub.server.dto.send;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.kri.common.datetime.LenientLocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import java.time.LocalDateTime;
@Getter
@Setter
@Schema(description = "단건 발송 요청 정보")
public class SendRequestSingleDto extends SendRequestBasicDto {
@NotNull
@Schema(description = "발송 템플릿")
private long tmplatIdx;
@NotBlank
@Schema(description = "발송 요청 서비스 (로그용)")
private String reqstSvc;
@Schema(description = "발송 요청 서비스의 프로젝트 코드 (로그용)")
private String prjctCd;
@NotNull
@Schema(description = "예약 여부")
private Boolean resve = false;
@Schema(description = "발송 희망 시간 (비어있는 경우 즉시)")
@LenientLocalDateTime
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime sendDt;
@NotNull
@Schema(description = "수신자 정보")
DestInfoDto destInfo;
}

View File

@@ -0,0 +1,23 @@
package com.kri.notihub.server.dto.send;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SmsCursorResponseDto {
@Schema(description = "SMS 결과 반영 스케줄러 커서(send_idx)")
private Long cursor;
public static SmsCursorResponseDto of(long cursor) {
return SmsCursorResponseDto.builder()
.cursor(cursor)
.build();
}
}

View File

@@ -0,0 +1,55 @@
package com.kri.notihub.server.dto.template;
import com.kri.notihub.server.common.enums.SendType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class TemplateBasicDto {
@NotNull
@Schema(description = "템플릿 타입")
public SendType tmplatTy;
@Size(max = 32)
@NotBlank
@Schema(description = "템플릿 명")
public String tmplatNm;
@Size(max = 128)
@Schema(description = "발송시 제목")
public String tmplatTitle;
@NotBlank
@Schema(description = "발송 내용")
public String tmplatBody;
@Schema(description = "이메일 건당 발송 딜레이(단위 ms, 기본: 500ms)")
public Short delayTime ;
@Size(max = 16)
@Schema(description = "발송 전화번호(문자 발송에서 사용)")
public String sendTel;
@Size(max = 64)
@Email
@Schema(description = "발송 이메일(이메일 발송에서 사용)")
public String sendEml;
@Size(max = 32)
@NotBlank
@Schema(description = "발송자 이름")
public String sendNm;
}

View File

@@ -0,0 +1,68 @@
package com.kri.notihub.server.dto.template;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.kri.notihub.server.common.enums.SendType;
import com.kri.notihub.server.persistence.entity.TTmplatEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.LocalDateTime;
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "템플릿 정보")
public class TemplateDto extends TemplateBasicDto{
@NotNull
@Schema(description = "템플릿 고유 키 (없으면 Create / 있으면 Update)")
public Long tmplatIdx;
@Size(max = 32)
@NotBlank
@Schema(description = "인트라넷 프로젝트 코드")
public String itrntPrjctCd;
@Size(max = 32)
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String regUser;
@Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime regDt;
@Size(max = 32)
@Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String modUser;
@Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime modDt;
public static TemplateDto from(TTmplatEntity entity) {
return TemplateDto.builder()
.tmplatIdx(entity.getTmplatIdx())
.itrntPrjctCd(entity.getItrntPrjctCd())
.tmplatTy(SendType.fromCode(entity.getTmplatTy()))
.tmplatNm(entity.getTmplatNm())
.tmplatTitle(entity.getTmplatTitle())
.tmplatBody(entity.getTmplatBody())
.delayTime(entity.getDelayTime())
.sendTel(entity.getSendTel())
.sendEml(entity.getSendEml())
.sendNm(entity.getSendNm())
.regUser(entity.getRegUser())
.regDt(entity.getRegDt())
.modUser(entity.getModUser())
.modDt(entity.getModDt())
.build();
}
}

View File

@@ -0,0 +1,26 @@
package com.kri.notihub.server.dto.template;
import com.kri.notihub.server.persistence.entity.TTmplatEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "템플릿 요약 정보")
public class TemplateSummaryDto {
@Schema(description = "템플릿 고유 키")
public Long tmplatIdx;
@Schema(description = "템플릿 명")
public String tmplatNm;
public static TemplateSummaryDto from(TTmplatEntity entity) {
return TemplateSummaryDto.builder()
.tmplatIdx(entity.getTmplatIdx())
.tmplatNm(entity.getTmplatNm())
.build();
}
}