261022_01_ENH: 예약 발송 취소 구현, record로 전환 가능한 Class Dto record로 전환, KKO 템플릿 등록시 사용 준비도 등록가능 템플릿으로 지정

This commit is contained in:
2026-10-22 12:33:32 +09:00
parent 7a1501d551
commit f2a9d6bfc6
58 changed files with 1090 additions and 1057 deletions

View File

@@ -2,11 +2,7 @@ package com.kri.notihub.server.dto.email;
import java.util.Objects;
public record EmailAttachmentDto(
String fileName,
String contentType,
byte[] content
) {
public record EmailAttachmentDto(String fileName, String contentType, byte[] content) {
public EmailAttachmentDto {
Objects.requireNonNull(fileName, "fileName is required");

View File

@@ -80,12 +80,32 @@ public class BulkSendInfoDto {
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime regDt;
@Schema(description = "벌크 취소 요청자")
private String cancelUser;
@Schema(description = "벌크 취소 요청 일시. 수신자 추가 등록 마감 기준")
private LocalDateTime cancelDt;
@Schema(description = "현재 취소 상태인 건수")
private long canceledCount;
@Schema(description = "취소 상태: NONE, PARTIAL, ALL")
private String cancellationStatus;
public void applyCanceledCount(long count, long targetCount) {
canceledCount = count;
cancellationStatus = count == 0 ? "NONE"
: count == targetCount ? "ALL" : "PARTIAL";
}
public static BulkSendInfoDto from(TBulkSendEntity entity) {
if (entity == null) {
return null;
}
return BulkSendInfoDto.builder()
.cancelUser(entity.getCancelUser())
.cancelDt(entity.getCancelDt())
.bulkSendKey(entity.getBulkSendKey())
.reqstSvc(entity.getReqstSvc())
.prjctCd(entity.getPrjctCd())

View File

@@ -2,17 +2,13 @@ package com.kri.notihub.server.dto.report;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
public class ReportExcelResponseDto {
public record ReportExcelResponseDto(
@Schema(description = "프론트가 저장용으로 쓸 파일명")
String fileName,
@Schema(description = "프론트가 저장용으로 쓸 파일명")
private String fileName;
@Schema(description = "엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)")
private String fileBase64;
@Schema(description = "엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)")
String fileBase64
) {
}

View File

@@ -3,25 +3,17 @@ package com.kri.notihub.server.dto.report;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDate;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "발송 비용 프로젝트별 요약 요청")
public class SendCostSummaryRequestDto {
public record SendCostSummaryRequestDto(
@Schema(description = "조회 시작 일시")
@NotNull
LocalDate startDt,
@Schema(description = "조회 시작 일시")
@NotNull
private LocalDate startDt;
@Schema(description = "조회 종료 일시")
@NotNull
private LocalDate endDt;
@Schema(description = "조회 종료 일시")
@NotNull
LocalDate endDt
) {
}

View File

@@ -5,46 +5,37 @@ import com.kri.notihub.server.common.enums.SendCorpType;
import com.kri.notihub.server.common.enums.SendType;
import com.kri.notihub.server.common.external.intranet.dto.IntranetProjectBaseInfoDto;
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SendCostSummaryWithItrntPrjctExcelDto {
public record SendCostSummaryWithItrntPrjctExcelDto(
@ExcelColumn(header = "요청 서비스", order = 0)
String reqstSvc,
@ExcelColumn(header = "요청 서비스", order = 0)
private String reqstSvc;
@ExcelColumn(header = "인트라넷 프로젝트 코드", order = 1)
String itrntPrjctCd,
@ExcelColumn(header = "인트라넷 프로젝트 코드", order = 1)
private String itrntPrjctCd;
@ExcelColumn(header = "프로젝트 명", order = 2)
String title,
@ExcelColumn(header = "프로젝트 명", order = 2)
private String title;
@ExcelColumn(header = "연구팀 명", order = 3)
String researchTeamName,
@ExcelColumn(header = "연구팀 명", order = 3)
private String researchTeamName;
@ExcelColumn(header = "발송 타입", order = 4)
String sendTy,
@ExcelColumn(header = "발송 타입", order = 4)
private String sendTy;
@ExcelColumn(header = "발송 업체", order = 5)
String sendCorp,
@ExcelColumn(header = "발송 업체", order = 5)
private String sendCorp;
@ExcelColumn(header = "발송 건수", order = 6)
Long sendCnt,
@ExcelColumn(header = "발송 건수", order = 6)
private Long sendCnt;
@ExcelColumn(header = "단가", order = 7)
private BigDecimal unitPrice;
@ExcelColumn(header = "총 비용", order = 8)
private BigDecimal totalPrice;
@ExcelColumn(header = "단가", order = 7)
BigDecimal unitPrice,
@ExcelColumn(header = "총 비용", order = 8)
BigDecimal totalPrice
) {
public static SendCostSummaryWithItrntPrjctExcelDto from(
SendCostSummaryWithItrntPrjctDto source) {
if (source == null) {
@@ -56,8 +47,8 @@ public class SendCostSummaryWithItrntPrjctExcelDto {
return SendCostSummaryWithItrntPrjctExcelDto.builder()
.reqstSvc(source.getReqstSvc())
.itrntPrjctCd(source.getItrntPrjctCd())
.title(projectInfo != null ? projectInfo.getTitle() : null)
.researchTeamName(projectInfo != null ? projectInfo.getResearchTeamName() : null)
.title(projectInfo != null ? projectInfo.title() : null)
.researchTeamName(projectInfo != null ? projectInfo.researchTeamName() : null)
.sendTy(getSendTypeLabel(source.getSendTy()))
.sendCorp(getSendCorpLabel(source.getSendCorp()))
.sendCnt(source.getSendCnt())

View File

@@ -2,6 +2,7 @@ package com.kri.notihub.server.dto.report;
import com.kri.common.feature.excel.ExcelColumn;
import com.kri.notihub.server.common.enums.SendStatusType;
import com.kri.notihub.server.common.consts.NotihubConst;
import com.kri.notihub.server.common.enums.SendType;
import com.kri.notihub.server.persistence.entity.TSendEntity;
import com.kri.notihub.server.persistence.entity.TSendResultCodeEntity;
@@ -11,123 +12,121 @@ import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;
import lombok.AllArgsConstructor;
import java.util.Objects;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "발송 정보")
public class SendInfoDto {
public record SendInfoDto(
@Size(max = 32)
@NotBlank
@Schema(description = "CMID")
String cmid,
@Size(max = 32)
@NotBlank
@Schema(description = "CMID")
private String cmid;
@Size(max = 32)
@Schema(description = "대량발송 키")
String bulkSendKey,
@Size(max = 32)
@Schema(description = "대량발송 키")
private String bulkSendKey;
@NotNull
@Schema(description = "발송 타입 코드")
Short sendTyCode,
@NotNull
@Schema(description = "발송 타입 코드")
private Short sendTyCode;
@NotNull
@Schema(description = "발송 타입 라벨")
String sendTyLabel,
@NotNull
@Schema(description = "발송 타입 라벨")
private String sendTyLabel;
@NotNull
@Schema(description = "예약 여부")
Boolean resve,
@NotNull
@Schema(description = "예약 여부")
private Boolean resve;
@NotNull
@Schema(description = "발송 상태")
Short sendStatusCode,
@NotNull
@Schema(description = "발송 상태")
private Short sendStatusCode;
@NotNull
@ExcelColumn(header = "발송 상태", order = 0)
@Schema(description = "발송 상태 라벨")
String sendStatusLabel,
@NotNull
@ExcelColumn(header = "발송 상태", order = 0)
@Schema(description = "발송 상태 라벨")
private String sendStatusLabel;
@NotNull
@Schema(description = "결과 코드")
Short resultCode,
@NotNull
@Schema(description = "결과 코드")
private Short resultCode;
@NotNull
@ExcelColumn(header = "발송 결과", order = 1)
@Schema(description = "결과 라벨")
String resultLabel,
@NotNull
@ExcelColumn(header = "발송 결과", order = 1)
@Schema(description = "결과 라벨")
private String resultLabel;
@Size(max = 16)
@NotBlank
@Schema(description = "요청 서비스")
String reqstSvc,
@Size(max = 16)
@NotBlank
@Schema(description = "요청 서비스")
private String reqstSvc;
@Size(max = 32)
@NotBlank
@Schema(description = "프로젝트 코드")
String prjctCd,
@Size(max = 32)
@NotBlank
@Schema(description = "프로젝트 코드")
private String prjctCd;
@Schema(description = "템플릿 인덱스")
Long tmplatIdx,
@Schema(description = "템플릿 인덱스")
private Long tmplatIdx;
@Size(max = 64)
@ExcelColumn(header = "발신지", order = 2)
@Schema(description = "발신지(EMAIL이면 sendEml, 아니면 sendTel)")
String sendFrom,
@Size(max = 64)
@ExcelColumn(header = "발신지", order = 2)
@Schema(description = "발신지(EMAIL이면 sendEml, 아니면 sendTel)")
private String sendFrom;
@Size(max = 32)
@ExcelColumn(header = "발신자명", order = 3)
@Schema(description = "발신자명")
String sendNm,
@Size(max = 32)
@ExcelColumn(header = "발신자명", order = 3)
@Schema(description = "발신자명")
private String sendNm;
@NotNull
@ExcelColumn(header = "발송 일시", order = 4)
@Schema(description = "발송 일시")
LocalDateTime sendDt,
@NotNull
@ExcelColumn(header = "발송 일시", order = 4)
@Schema(description = "발송 일시")
private LocalDateTime sendDt;
@Size(max = 128)
@NotBlank
@ExcelColumn(header = "SID", order = 5)
@Schema(description = "SID")
String sid,
@Size(max = 128)
@NotBlank
@ExcelColumn(header = "SID", order = 5)
@Schema(description = "SID")
private String sid;
@Size(max = 64)
@ExcelColumn(header = "수신지", order = 6)
@Schema(description = "수신지(EMAIL이면 destEml, 아니면 destTel)")
String destTo,
@Size(max = 64)
@ExcelColumn(header = "수신지", order = 6)
@Schema(description = "수신지(EMAIL이면 destEml, 아니면 destTel)")
private String destTo;
@Size(max = 32)
@ExcelColumn(header = "수신자명", order = 7)
@Schema(description = "수신자명")
String destNm,
@Size(max = 32)
@ExcelColumn(header = "수신자명", order = 7)
@Schema(description = "수신자명")
private String destNm;
@ExcelColumn(header = "발송 결과 확인 일시", order = 8)
@Schema(description = "리포트 일시")
LocalDateTime reportDt,
@ExcelColumn(header = "발송 결과 확인 일시", order = 8)
@Schema(description = "리포트 일시")
private LocalDateTime reportDt;
@Size(max = 32)
@NotBlank
@Schema(description = "등록 회사")
String regCmpn,
@Size(max = 32)
@NotBlank
@Schema(description = "등록 회사")
private String regCmpn;
@Size(max = 32)
@NotBlank
@ExcelColumn(header = "발송 요청자", order = 9)
@Schema(description = "등록자")
String regUser,
@Size(max = 32)
@NotBlank
@ExcelColumn(header = "발송 요청자", order = 9)
@Schema(description = "등록자")
private String regUser;
@NotNull
@ExcelColumn(header = "발송 요청 일시", order = 10)
@Schema(description = "등록일시")
LocalDateTime regDt,
@NotNull
@ExcelColumn(header = "발송 요청 일시", order = 10)
@Schema(description = "등록일시")
private LocalDateTime regDt;
@ExcelColumn(header = "취소 처리자", order = 11)
String cancelUser,
@ExcelColumn(header = "취소 처리 일시", order = 12)
LocalDateTime cancelDt
) {
public static SendInfoDto from(TSendEntity entity, List<TSendResultCodeEntity> resultCodeEntity) {
if (entity == null) {
return null;
@@ -146,15 +145,19 @@ public class SendInfoDto {
.orElse(null); // 없으면 null
return SendInfoDto.builder()
.cancelUser(entity.getCancelUser())
.cancelDt(entity.getCancelDt())
.cmid(entity.getCmid())
.bulkSendKey(entity.getBulkSendKey())
.sendTyCode(entity.getSendTy())
.sendTyLabel(SendType.fromCode(entity.getSendTy()).name())
.resve(entity.isResve())
.sendStatusCode(entity.getSendStatus())
.sendStatusLabel(SendStatusType.fromCode(entity.getSendStatus()).name())
.sendStatusLabel(Objects.equals(entity.getSendStatus(), SendStatusType.CANCELED.getCode())
? NotihubConst.CANCELED_LABEL : SendStatusType.fromCode(entity.getSendStatus()).name())
.resultCode(entity.getResultCode())
.resultLabel(resultViewLabel)
.resultLabel(Objects.equals(entity.getSendStatus(), SendStatusType.CANCELED.getCode())
? NotihubConst.CANCELED_LABEL : resultViewLabel)
.reqstSvc(entity.getReqstSvc())
.prjctCd(entity.getPrjctCd())
.tmplatIdx(entity.getTmplatIdx())

View File

@@ -5,38 +5,29 @@ 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.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "발송 결과 코드")
public class SendResultCodeDto {
public record SendResultCodeDto(
@NotNull
@Schema(description = "결과 코드")
Short resultCode,
@NotNull
@Schema(description = "결과 코드")
private Short resultCode;
@NotNull
@Schema(description = "결과 타입")
Short resultTy,
@NotNull
@Schema(description = "결과 타입")
private Short resultTy;
@Size(max = 128)
@NotBlank
@Schema(description = "결과 라벨")
private String resultLabel;
@Size(max = 128)
@NotBlank
@Schema(description = "결과 표시 라벨")
private String resultViewLabel;
@Size(max = 128)
@NotBlank
@Schema(description = "결과 라벨")
String resultLabel,
@Size(max = 128)
@NotBlank
@Schema(description = "결과 표시 라벨")
String resultViewLabel
) {
public static SendResultCodeDto from(TSendResultCodeEntity entity) {
if (entity == null) {
return null;

View File

@@ -1,6 +1,8 @@
package com.kri.notihub.server.dto.report;
import com.kri.notihub.server.persistence.entity.TSendEntity;
import com.kri.notihub.server.common.consts.NotihubConst;
import com.kri.notihub.server.common.enums.SendStatusType;
import com.kri.notihub.server.persistence.entity.TSendResultCodeEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -9,107 +11,107 @@ import jakarta.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "발송 결과 정보")
public class SendResultInfoDto {
public record SendResultInfoDto(
@Schema(description = "발송 이력 ID")
Long sendIdx,
@Schema(description = "CMID")
private String cmid;
@Schema(description = "취소 처리자")
String cancelUser,
@Schema(description = "대량 발송 키")
private String bulkSendKey;
@Schema(description = "취소 처리 일시. 실제 발송 결과가 확인된 뒤에도 이력 유지")
LocalDateTime cancelDt,
@Schema(description = "인트라넷 프로젝트 코드")
private String itrntPrjctCd;
@Schema(description = "CMID")
String cmid,
@Schema(description = "요청 서비스")
private String reqstSvc;
@Schema(description = "대량 발송 키")
String bulkSendKey,
@Schema(description = "프로젝트 코드")
private String prjctCd;
@Schema(description = "인트라넷 프로젝트 코드")
String itrntPrjctCd,
@Schema(description = "리스트 아이디")
private String sid;
@Schema(description = "요청 서비스")
String reqstSvc,
@NotNull
@Schema(description = "발송 타입")
private Short sendTy;
@Schema(description = "프로젝트 코드")
String prjctCd,
@NotNull
@Schema(description = "예약 여부")
private Boolean resve;
@Schema(description = "리스트 아이디")
String sid,
@NotNull
@Schema(description = "결과 코드")
private Short resultCode;
@NotNull
@Schema(description = "발송 타입")
Short sendTy,
@Size(max = 128)
@Schema(description = "결과 라벨")
private String resultLabel;
@NotNull
@Schema(description = "예약 여부")
Boolean resve,
@Size(max = 128)
@Schema(description = "결과 표시 라벨")
private String resultViewLabel;
@NotNull
@Schema(description = "결과 코드")
Short resultCode,
@Schema(description = "템플릿 인덱스")
private Long tmplatIdx;
@Size(max = 128)
@Schema(description = "결과 라벨")
String resultLabel,
@Size(max = 64)
@Schema(description = "카카오 템플릿 코드")
private String kkoTmplatCd;
@Size(max = 128)
@Schema(description = "결과 표시 라벨")
String resultViewLabel,
@Size(max = 64)
@Schema(description = "발신 이메일")
private String sendEml;
@Schema(description = "템플릿 인덱스")
Long tmplatIdx,
@Size(max = 16)
@Schema(description = "발신 전화번호")
private String sendTel;
@Size(max = 64)
@Schema(description = "카카오 템플릿 코드")
String kkoTmplatCd,
@Size(max = 32)
@Schema(description = "발신자명")
private String sendNm;
@Size(max = 64)
@Schema(description = "발신 이메일")
String sendEml,
@NotNull
@Schema(description = "발송 일시")
private LocalDateTime sendDt;
@Size(max = 16)
@Schema(description = "발신 전화번호")
String sendTel,
@Size(max = 64)
@Schema(description = "수신 이메일")
private String destEml;
@Size(max = 32)
@Schema(description = "발신자명")
String sendNm,
@Size(max = 32)
@Schema(description = "수신자명")
private String destNm;
@NotNull
@Schema(description = "발송 일시")
LocalDateTime sendDt,
@Size(max = 16)
@Schema(description = "수신 전화번호")
private String destTel;
@Size(max = 64)
@Schema(description = "수신 이메일")
String destEml,
@Size(max = 32)
@NotBlank
@Schema(description = "등록 회사")
private String regCmpn;
@Size(max = 32)
@Schema(description = "수신자명")
String destNm,
@Size(max = 32)
@NotBlank
@Schema(description = "등록자")
private String regUser;
@Size(max = 16)
@Schema(description = "수신 전화번호")
String destTel,
@NotNull
@Schema(description = "등록 일시")
private LocalDateTime regDt;
@Size(max = 32)
@NotBlank
@Schema(description = "등록 회사")
String regCmpn,
@Size(max = 32)
@NotBlank
@Schema(description = "등록자")
String regUser,
@NotNull
@Schema(description = "등록 일시")
LocalDateTime regDt
) {
public static SendResultInfoDto from(TSendEntity entity) {
return from(entity, null);
}
@@ -121,8 +123,12 @@ public class SendResultInfoDto {
}
TSendResultCodeEntity resultCode = findResultCode(entity, resultCodeEntity);
boolean canceled = Objects.equals(entity.getSendStatus(), SendStatusType.CANCELED.getCode());
return SendResultInfoDto.builder()
.sendIdx(entity.getSendIdx())
.cancelUser(entity.getCancelUser())
.cancelDt(entity.getCancelDt())
.cmid(entity.getCmid())
.bulkSendKey(entity.getBulkSendKey())
.itrntPrjctCd(entity.getItrntPrjctCd())
@@ -132,8 +138,10 @@ public class SendResultInfoDto {
.sendTy(entity.getSendTy())
.resve(entity.isResve())
.resultCode(entity.getResultCode())
.resultLabel(resultCode != null ? resultCode.getResultLabel() : null)
.resultViewLabel(resultCode != null ? resultCode.getResultViewLabel() : null)
.resultLabel(canceled ? NotihubConst.CANCELED_LABEL
: resultCode != null ? resultCode.getResultLabel() : null)
.resultViewLabel(canceled ? NotihubConst.CANCELED_LABEL
: resultCode != null ? resultCode.getResultViewLabel() : null)
.tmplatIdx(entity.getTmplatIdx())
.kkoTmplatCd(entity.getKkoTmplatCd())
.sendEml(entity.getSendEml())

View File

@@ -2,36 +2,28 @@ package com.kri.notihub.server.dto.report;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import lombok.Builder;
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(description = "발송 결과 정보")
public class SendResultLastWithSidDto {
public record SendResultLastWithSidDto(
@Schema(description = "리스트 아이디")
String sid,
@Schema(description = "리스트 아이디")
private String sid;
@Schema(description = "마지막 결과 코드")
Short lastResultCode,
@Schema(description = "마지막 결과 코드")
private Short lastResultCode;
@Schema(description = "마지막 결과 라벨")
String lastResultLabel,
@Schema(description = "마지막 결과 라벨")
private String lastResultLabel;
@Schema(description = "마지막 결과 표시 라벨")
String lastResultViewLabel,
@Schema(description = "마지막 결과 표시 라벨")
private String lastResultViewLabel;
@Schema(description = "마지막 발송 일시")
LocalDateTime lastSendDt,
@Schema(description = "마지막 발송 일시")
private LocalDateTime lastSendDt;
@Schema(description = "총 발송 Count")
private Integer totalSendCount;
@Schema(description = "총 발송 Count")
Integer totalSendCount
) {
}

View File

@@ -30,6 +30,9 @@ public class SendResultSummaryDto {
@Schema(description = "대기중 카운트")
private Long standByCount;
@Schema(description = "현재 취소 상태인 건수")
private Long canceledCount;
@Schema(description = "전체 카운트")
private Long totalCount;
}

View File

@@ -1,38 +1,28 @@
package com.kri.notihub.server.dto.report;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "발송 축약 결과 요청")
public class SendResultSummaryRequestDto {
public record SendResultSummaryRequestDto(
@Schema(description = "대량발송 키")
String bulkSendKey,
@Schema(description = "대량발송 키")
private String bulkSendKey;
@Schema(description = "인트라넷 프로젝트 코드")
String itrntPrjctCd,
@Schema(description = "인트라넷 프로젝트 코드")
private String itrntPrjctCd;
@Schema(description = "요청 서비스")
String reqstSvc,
@Schema(description = "요청 서비스")
private String reqstSvc;
@Schema(description = "프로젝트 코드")
String prjctCd,
@Schema(description = "프로젝트 코드")
private String prjctCd;
@Schema(description = "발송일시 조회 시작")
private LocalDateTime sendStartDt;
@Schema(description = "발송일시 조회 종료")
private LocalDateTime sendEndDt;
@Schema(description = "발송일시 조회 시작")
LocalDateTime sendStartDt,
@Schema(description = "발송일시 조회 종료")
LocalDateTime sendEndDt
) {
}

View File

@@ -1,23 +1,16 @@
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 BizppurioCursorResponseDto {
@Schema(description = "SMS 결과 반영 스케줄러 커서(send_idx)")
private Long cursor;
public record BizppurioCursorResponseDto(
@Schema(description = "SMS 결과 반영 스케줄러 커서(send_idx)")
Long cursor
) {
public static BizppurioCursorResponseDto of(long cursor) {
return BizppurioCursorResponseDto.builder()
.cursor(cursor)
.build();
}
}
}

View File

@@ -1,29 +1,22 @@
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 {
public record BulkSendResponseDto(
@Schema(description = "bulkSendKey")
String bulkSendKey,
@Schema(description = "bulkSendKey")
private String bulkSendKey;
@Schema(description = "요청 건수")
Integer requestCount,
@Schema(description = "요청 건수")
private Integer requestCount;
@Schema(description = "발송 접수 건수(대기 또는 즉시 성공)")
private Integer acceptCount;
@Schema(description = "발송 접수 실패 건수")
private Integer failCount;
@Schema(description = "발송 접수 건수(대기 또는 즉시 성공)")
Integer acceptCount,
@Schema(description = "발송 접수 실패 건수")
Integer failCount
) {
public static BulkSendResponseDto of(String bulkSendKey, Integer requestCount,
Integer acceptCount, Integer failCount) {
return BulkSendResponseDto.builder()

View File

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

View File

@@ -5,30 +5,23 @@ import com.kri.common.feature.datetime.DateTimeUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.Instant;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmailPollQueueItemDto {
public record EmailPollQueueItemDto(
@Schema(description = "Pringo return_key(cmid)")
String cmid,
@Schema(description = "Pringo return_key(cmid)")
private String cmid;
@Schema(description = "폴링 시도 횟수(0부터 시작)")
Integer attempt,
@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;
@Schema(description = "구동까지 남은 시간(ms)")
Long remainingMs,
@Schema(description = "구동 예상 시간(KST LocalDateTime)")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
LocalDateTime triggerAt
) {
public static EmailPollQueueItemDto of(String cmid, int attempt, long remainingMs,
long triggerAtEpochMs) {
return EmailPollQueueItemDto.builder()

View File

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

View File

@@ -0,0 +1,11 @@
package com.kri.notihub.server.dto.send;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
public record SendCancelBulkRequestDto(
@NotBlank
@Size(max = 32)
String bulkSendKey
) {
}

View File

@@ -0,0 +1,14 @@
package com.kri.notihub.server.dto.send;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
@Schema(description = "싱글/벌크 예약 취소 결과. 문자·알림톡은 큐 제거 기준이며 미발송을 보장하지 않음")
@Builder
public record SendCancelResponseDto(
long targetCount,
long canceledCount,
long alreadyCanceledCount,
long notCancelableCount
) {
}

View File

@@ -0,0 +1,11 @@
package com.kri.notihub.server.dto.send;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
public record SendCancelSingleRequestDto(
@NotNull
@Positive
Long sendIdx
) {
}

View File

@@ -2,26 +2,17 @@ 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.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "이메일/문자 발송 결과")
public class SendInternalResultDto {
public record SendInternalResultDto(
String cmid,
private String cmid;
private SendStatusType status;
private Short resultCode;
SendStatusType status,
Short resultCode
) {
public static SendInternalResultDto of(String cmid, SendStatusType status, short resultCode) {
return SendInternalResultDto.builder()
.cmid(cmid)

View File

@@ -2,32 +2,34 @@ package com.kri.notihub.server.dto.send;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "단건 발송 접수 결과")
public class SendSingleResponseDto {
public record SendSingleResponseDto(
@Schema(description = "발송 이력 ID")
Long sendIdx,
@Schema(description = "발송 고유 키")
String cmid,
@Schema(description = "템플릿 목적별 추가 응답 정보")
Map<String, Object> data
) {
public static final String VERIFICATION_ID_KEY = "verificationId";
public static final String EXPIRE_DT_KEY = "expireDt";
@Schema(description = "발송 고유 키")
private String cmid;
@Builder.Default
@Schema(description = "템플릿 목적별 추가 응답 정보")
private Map<String, Object> data = Map.of();
public static SendSingleResponseDto of(String cmid, Map<String, Object> data) {
public static SendSingleResponseDto of(Long sendIdx, String cmid, Map<String, Object> data) {
return SendSingleResponseDto.builder()
.sendIdx(sendIdx)
.cmid(cmid)
.data(data == null ? Map.of() : Map.copyOf(data))
.build();
}
public static class SendSingleResponseDtoBuilder {
private Map<String, Object> data = Map.of();
}
}

View File

@@ -3,33 +3,29 @@ package com.kri.notihub.server.dto.template;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
public class KkoTemplateDetailDto {
private String templateCode;
private String templateName;
private String templateContent;
private String templatePreviewMessage;
private String templateMessageType;
private String templateEmphasizeType;
private String inspectionStatus;
private String status;
private Boolean block;
private Boolean dormant;
private String templateExtra;
private String templateImageName;
private String templateImageUrl;
private String templateTitle;
private String templateSubtitle;
private String templateHeader;
private JsonNode templateItemHighlight;
private JsonNode templateItem;
private JsonNode templateRepresentLink;
private List<JsonNode> buttons;
private List<JsonNode> quickReplies;
public record KkoTemplateDetailDto(
String templateCode,
String templateName,
String templateContent,
String templatePreviewMessage,
String templateMessageType,
String templateEmphasizeType,
String inspectionStatus,
String status,
Boolean block,
Boolean dormant,
String templateExtra,
String templateImageName,
String templateImageUrl,
String templateTitle,
String templateSubtitle,
String templateHeader,
JsonNode templateItemHighlight,
JsonNode templateItem,
JsonNode templateRepresentLink,
List<JsonNode> buttons,
List<JsonNode> quickReplies
) {
}

View File

@@ -3,19 +3,11 @@ package com.kri.notihub.server.dto.template;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class KkoTemplateDetailRequestDto {
@NotBlank
@Size(max = 30)
@Pattern(regexp = "[A-Za-z0-9_-]+")
private String templateCode;
public record KkoTemplateDetailRequestDto(
@NotBlank
@Size(max = 30)
@Pattern(regexp = "[A-Za-z0-9_-]+")
String templateCode
) {
}

View File

@@ -1,21 +1,12 @@
package com.kri.notihub.server.dto.template;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@NoArgsConstructor
public class KkoTemplateListRequestDto {
@Size(min = 2, max = 50)
private String keyword;
public KkoTemplateListRequestDto(String keyword) {
setKeyword(keyword);
}
public void setKeyword(String keyword) {
this.keyword = keyword == null || keyword.isBlank() ? null : keyword.trim();
public record KkoTemplateListRequestDto(
@Size(min = 2, max = 50)
String keyword
) {
public KkoTemplateListRequestDto {
keyword = keyword == null || keyword.isBlank() ? null : keyword.trim();
}
}

View File

@@ -1,19 +1,11 @@
package com.kri.notihub.server.dto.template;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class KkoTemplateListResponseDto {
private int totalCount;
private int totalPage;
private int currentPage;
private List<KkoTemplateSummaryDto> list;
public record KkoTemplateListResponseDto(
int totalCount,
int totalPage,
int currentPage,
List<KkoTemplateSummaryDto> list
) {
}

View File

@@ -1,21 +1,13 @@
package com.kri.notihub.server.dto.template;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class KkoTemplateSummaryDto {
private String templateCode;
private String templateName;
private String serviceStatus;
private String createdAt;
private String modifiedAt;
public record KkoTemplateSummaryDto(
String templateCode,
String templateName,
String serviceStatus,
String createdAt,
String modifiedAt
) {
}

View File

@@ -3,29 +3,20 @@ package com.kri.notihub.server.dto.template;
import com.kri.notihub.server.common.enums.TemplatePurpose;
import com.kri.notihub.server.persistence.entity.TTmplatEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "템플릿 요약 정보")
public class TemplateSummaryDto {
public record TemplateSummaryDto(
@Schema(description = "템플릿 고유 키")
Long tmplatIdx,
@Schema(description = "템플릿 고유 키")
private Long tmplatIdx;
@Schema(description = "템플릿 명")
private String tmplatNm;
@Schema(description = "템플릿 목적")
private TemplatePurpose tmplatPurpose;
@Schema(description = "템플릿 명")
String tmplatNm,
@Schema(description = "템플릿 목적")
TemplatePurpose tmplatPurpose
) {
public static TemplateSummaryDto from(TTmplatEntity entity) {
return TemplateSummaryDto.builder()
.tmplatIdx(entity.getTmplatIdx())

View File

@@ -4,29 +4,25 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "휴대전화번호 인증 요청")
public class PhoneVerificationRequestDto {
public record PhoneVerificationRequestDto(
@NotBlank
@Pattern(
regexp = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
message = "verificationId는 UUID 형식이어야 합니다."
)
@Schema(description = "인증 발급 UUID")
String verificationId,
@NotBlank
@Pattern(
regexp = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
message = "verificationId는 UUID 형식이어야 합니다."
)
@Schema(description = "인증 발급 UUID")
private String verificationId;
@NotBlank
@Size(max = 16)
@Schema(description = "인증 대상 휴대전화번호")
String sendTel,
@NotBlank
@Size(max = 16)
@Schema(description = "인증 대상 휴대전화번호")
private String sendTel;
@NotBlank
@Pattern(regexp = "^[0-9]{6}$", message = "verificationCode는 숫자 6자리여야 합니다.")
@Schema(description = "6자리 인증번호")
private String verificationCode;
@NotBlank
@Pattern(regexp = "^[0-9]{6}$", message = "verificationCode는 숫자 6자리여야 합니다.")
@Schema(description = "6자리 인증번호")
String verificationCode
) {
}

View File

@@ -3,27 +3,20 @@ package com.kri.notihub.server.dto.verification;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "휴대전화번호 인증 결과")
public class PhoneVerificationResponseDto {
public record PhoneVerificationResponseDto(
String verificationId,
private String verificationId;
String sendTel,
private String sendTel;
private boolean verified;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime verifiedDt;
boolean verified,
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
LocalDateTime verifiedDt
) {
public static PhoneVerificationResponseDto of(
String verificationId,
String sendTel,