260212_01_DOC: 프로젝트 전체에 구글 java 스타일 적용

This commit is contained in:
2026-02-12 11:24:10 +09:00
parent 6bd9b0902b
commit 774188088b
70 changed files with 3735 additions and 3388 deletions

View File

@@ -6,9 +6,12 @@ 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;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@@ -18,82 +21,84 @@ import java.time.LocalDateTime;
@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 = 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 = 16)
@NotBlank
@Schema(description = "요청 서비스")
private String reqstSvc;
@Size(max = 32)
@NotBlank
@Schema(description = "프로젝트 코드")
private String prjctCd;
@Size(max = 32)
@NotBlank
@Schema(description = "프로젝트 코드")
private String prjctCd;
@Schema(description = "템플릿 인덱스")
private Long tmplatIdx;
@Schema(description = "템플릿 인덱스")
private Long tmplatIdx;
@NotNull
@Schema(description = "예약 여부")
private Boolean resve;
@NotNull
@Schema(description = "예약 여부")
private Boolean resve;
@NotNull
@Schema(description = "발송일시")
private LocalDateTime sendDt;
@NotNull
@Schema(description = "발송일시")
private LocalDateTime sendDt;
@NotNull
@Schema(description = "대상 건수")
private Integer trgtCnt;
@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 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 succesCnt;
@NotNull
@Schema(description = "실패 건수", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Integer failCnt;
@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;
@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;
@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;
@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();
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

@@ -10,9 +10,9 @@ import lombok.Setter;
@Builder
public class ReportExcelResponseDto {
@Schema(description = "프론트가 저장용으로 쓸 파일명")
private String errorFileName;
@Schema(description = "프론트가 저장용으로 쓸 파일명")
private String errorFileName;
@Schema(description = "에러 엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)")
private String errorFileBase64;
@Schema(description = "에러 엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)")
private String errorFileBase64;
}

View File

@@ -9,10 +9,13 @@ 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;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@@ -22,146 +25,148 @@ import java.util.List;
@Schema(description = "발송 정보")
public class SendInfoDto {
@Size(max = 32)
@NotBlank
@Schema(description = "CMID")
private String cmid;
@Size(max = 32)
@NotBlank
@Schema(description = "CMID")
private String cmid;
@Size(max = 32)
@Schema(description = "대량발송 키")
private String bulkSendKey;
@Size(max = 32)
@Schema(description = "대량발송 키")
private String bulkSendKey;
@NotNull
@Schema(description = "발송 타입 코드")
private Short sendTyCode;
@NotNull
@Schema(description = "발송 타입 코드")
private Short sendTyCode;
@NotNull
@Schema(description = "발송 타입 라벨")
private String sendTyLabel;
@NotNull
@Schema(description = "발송 타입 라벨")
private String sendTyLabel;
@NotNull
@Schema(description = "예약 여부")
private Boolean resve;
@NotNull
@Schema(description = "예약 여부")
private Boolean resve;
@NotNull
@Schema(description = "발송 상태")
private Short sendStatusCode;
@NotNull
@Schema(description = "발송 상태")
private Short sendStatusCode;
@NotNull
@ExcelColumn(header = "발송 상태", order = 0)
@Schema(description = "발송 상태 라벨")
private String sendStatusLabel;
@NotNull
@ExcelColumn(header = "발송 상태", order = 0)
@Schema(description = "발송 상태 라벨")
private String sendStatusLabel;
@NotNull
@Schema(description = "결과 코드")
private Short resultCode;
@NotNull
@Schema(description = "결과 코드")
private Short resultCode;
@NotNull
@ExcelColumn(header = "발송 결과", order = 1)
@Schema(description = "결과 라벨")
private String resultLabel;
@NotNull
@ExcelColumn(header = "발송 결과", order = 1)
@Schema(description = "결과 라벨")
private String resultLabel;
@Size(max = 16)
@NotBlank
@Schema(description = "요청 서비스")
private String reqstSvc;
@Size(max = 16)
@NotBlank
@Schema(description = "요청 서비스")
private String reqstSvc;
@Size(max = 32)
@NotBlank
@Schema(description = "프로젝트 코드")
private String prjctCd;
@Size(max = 32)
@NotBlank
@Schema(description = "프로젝트 코드")
private String prjctCd;
@Schema(description = "템플릿 인덱스")
private Long tmplatIdx;
@Schema(description = "템플릿 인덱스")
private Long tmplatIdx;
@Size(max = 64)
@ExcelColumn(header = "발신지", order = 2)
@Schema(description = "발신지(EMAIL이면 sendEml, 아니면 sendTel)")
private 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 = "발신자명")
private String sendNm;
@Size(max = 32)
@ExcelColumn(header = "발신자명", order = 3)
@Schema(description = "발신자명")
private String sendNm;
@NotNull
@ExcelColumn(header = "발송 일시", order = 4)
@Schema(description = "발송 일시")
private LocalDateTime sendDt;
@NotNull
@ExcelColumn(header = "발송 일시", order = 4)
@Schema(description = "발송 일시")
private LocalDateTime sendDt;
@Size(max = 128)
@NotBlank
@ExcelColumn(header = "SID", order = 5)
@Schema(description = "SID")
private 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)")
private 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 = "수신자명")
private String destNm;
@Size(max = 32)
@ExcelColumn(header = "수신자명", order = 7)
@Schema(description = "수신자명")
private String destNm;
@ExcelColumn(header = "발송 결과 확인 일시", order = 8)
@Schema(description = "리포트 일시")
private LocalDateTime reportDt;
@ExcelColumn(header = "발송 결과 확인 일시", order = 8)
@Schema(description = "리포트 일시")
private LocalDateTime reportDt;
@Size(max = 32)
@NotBlank
@Schema(description = "등록 회사")
private String regCmpn;
@Size(max = 32)
@NotBlank
@Schema(description = "등록 회사")
private String regCmpn;
@Size(max = 32)
@NotBlank
@ExcelColumn(header = "발송 요청자", order = 9)
@Schema(description = "등록자")
private String regUser;
@Size(max = 32)
@NotBlank
@ExcelColumn(header = "발송 요청자", order = 9)
@Schema(description = "등록자")
private String regUser;
@NotNull
@ExcelColumn(header = "발송 요청 일시", order = 10)
@Schema(description = "등록일시")
private LocalDateTime regDt;
@NotNull
@ExcelColumn(header = "발송 요청 일시", order = 10)
@Schema(description = "등록일시")
private LocalDateTime regDt;
public static SendInfoDto from(TSendEntity entity, List<TSendResultCodeEntity> resultCodeEntity) {
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();
String resultViewLabel = resultCodeEntity.stream()
.filter(e -> e.getId() != null && e.getId().getResultCode().equals(entity.getResultCode()))
.map(TSendResultCodeEntity::getResultViewLabel)
.findFirst()
.orElse(null); // 없으면 null
return SendInfoDto.builder()
.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())
.resultCode(entity.getResultCode())
.resultLabel(resultViewLabel)
.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();
public static SendInfoDto from(TSendEntity entity, List<TSendResultCodeEntity> resultCodeEntity) {
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();
String resultViewLabel = resultCodeEntity.stream()
.filter(e -> e.getId() != null && e.getId().getResultCode().equals(entity.getResultCode()))
.map(TSendResultCodeEntity::getResultViewLabel)
.findFirst()
.orElse(null); // 없으면 null
return SendInfoDto.builder()
.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())
.resultCode(entity.getResultCode())
.resultLabel(resultViewLabel)
.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

@@ -5,9 +5,12 @@ 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;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@@ -16,37 +19,30 @@ import java.time.LocalDateTime;
@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;
@Size(max = 32)
@NotBlank
@Schema(description = "발송 요청 회사")
String reqstCmpn;
@Size(max = 32)
@NotBlank
@Schema(description = "발송 요청자")
String reqstUser;
@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;
}

View File

@@ -12,24 +12,25 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class BulkSendResponseDto {
@Schema(description = "bulkSendKey")
private String bulkSendKey;
@Schema(description = "bulkSendKey")
private String bulkSendKey;
@Schema(description = "요청 건수")
private Integer requestCount;
@Schema(description = "요청 건수")
private Integer requestCount;
@Schema(description = "Pringo send 요청 성공(return_key 수신) 건수")
private Integer acceptCount;
@Schema(description = "Pringo send 요청 성공(return_key 수신) 건수")
private Integer acceptCount;
@Schema(description = "Pringo send 요청 실패(return_key 미수신) 건수")
private Integer failCount;
@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();
}
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

@@ -4,9 +4,12 @@ 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;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@@ -16,32 +19,32 @@ import java.util.Map;
@Schema(description = "수신 정보")
public class DestInfoDto {
@Schema(description = "리스트 아이디")
private String sid;
@Schema(description = "리스트 아이디")
private String sid;
@Size(max = 64)
@Email
@Schema(description = "수신 이메일 (이메일 발송에서 사용)")
private String destEml;
@Size(max = 64)
@Email
@Schema(description = "수신 이메일 (이메일 발송에서 사용)")
private String destEml;
@Size(max = 16)
@Schema(description = "수신 전화번호 (문자 발송에서 사용)")
private String destTel;
@Size(max = 16)
@Schema(description = "수신 전화번호 (문자 발송에서 사용)")
private String destTel;
@Size(max = 32)
@Schema(description = "수신자 이름")
private String destNm;
@Size(max = 32)
@Schema(description = "수신자 이름")
private String destNm;
@Schema(description = "수신 파라미터 (템플릿 내용 파싱용)")
private Map<String, String> msgParam;
@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();
}
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

@@ -3,39 +3,39 @@ 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 java.time.Instant;
import java.time.LocalDateTime;
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 = "Pringo return_key(cmid)")
private String cmid;
@Schema(description = "폴링 시도 횟수(0부터 시작)")
private Integer attempt;
@Schema(description = "폴링 시도 횟수(0부터 시작)")
private Integer attempt;
@Schema(description = "구동까지 남은 시간(ms)")
private Long remainingMs;
@Schema(description = "구동까지 남은 시간(ms)")
private Long remainingMs;
@Schema(description = "구동 예상 시간(KST LocalDateTime)")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime triggerAt;
@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();
}
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

@@ -1,28 +1,28 @@
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;
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;
@Schema(description = "Queue size (snapshot)")
private Integer size;
public static EmailPollQueueResponseDto of(List<EmailPollQueueItemDto> items) {
return EmailPollQueueResponseDto.builder()
.size(items != null ? items.size() : 0)
.items(items)
.build();
}
@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

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

View File

@@ -2,9 +2,12 @@ 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.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@@ -14,16 +17,16 @@ import lombok.*;
@Schema(description = "발송 기본 정보")
public class SendRequestBasicDto {
@Size(max = 64)
@Email
@Schema(description = "발신 이메일 (이메일 발송에만 사용)")
private String sendEml;
@Size(max = 64)
@Email
@Schema(description = "발신 이메일 (이메일 발송에만 사용)")
private String sendEml;
@Size(max = 16)
@Schema(description = "발신 전화번호 (문자 발송에만 사용)")
private String sendTel;
@Size(max = 16)
@Schema(description = "발신 전화번호 (문자 발송에만 사용)")
private String sendTel;
@Size(max = 32)
@Schema(description = "발신 이름")
private String sendNm;
@Size(max = 32)
@Schema(description = "발신 이름")
private String sendNm;
}

View File

@@ -4,20 +4,21 @@ 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;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "일괄 발송 요청 정보")
public class SendRequestBulkDto extends SendRequestBasicDto {
@Size(max = 32)
@NotBlank
@Schema(description = "일괄 발송 고유키")
String bulkSendKey;
@Size(max = 32)
@NotBlank
@Schema(description = "일괄 발송 고유키")
String bulkSendKey;
@NotNull
@Schema(description = "수신자 정보")
List<DestInfoDto> destInfoList;
@NotNull
@Schema(description = "수신자 정보")
List<DestInfoDto> destInfoList;
}

View File

@@ -5,36 +5,31 @@ 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;
import lombok.Getter;
import lombok.Setter;
@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;
@NotNull
@Schema(description = "수신자 정보")
DestInfoDto destInfo;
@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;
}

View File

@@ -12,12 +12,12 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class SmsCursorResponseDto {
@Schema(description = "SMS 결과 반영 스케줄러 커서(send_idx)")
private Long cursor;
@Schema(description = "SMS 결과 반영 스케줄러 커서(send_idx)")
private Long cursor;
public static SmsCursorResponseDto of(long cursor) {
return SmsCursorResponseDto.builder()
.cursor(cursor)
.build();
}
public static SmsCursorResponseDto of(long cursor) {
return SmsCursorResponseDto.builder()
.cursor(cursor)
.build();
}
}

View File

@@ -19,42 +19,42 @@ import lombok.experimental.SuperBuilder;
@AllArgsConstructor
public class TemplateBasicDto {
@Size(max = 32)
@NotBlank
@Schema(description = "인트라넷 프로젝트 코드")
public String itrntPrjctCd;
@Size(max = 32)
@NotBlank
@Schema(description = "인트라넷 프로젝트 코드")
public String itrntPrjctCd;
@NotNull
@Schema(description = "템플릿 타입")
public SendType tmplatTy;
@NotNull
@Schema(description = "템플릿 타입")
public SendType tmplatTy;
@Size(max = 32)
@NotBlank
@Schema(description = "템플릿 명")
public String tmplatNm;
@Size(max = 32)
@NotBlank
@Schema(description = "템플릿 명")
public String tmplatNm;
@Size(max = 128)
@Schema(description = "발송시 제목")
public String tmplatTitle;
@Size(max = 128)
@Schema(description = "발송시 제목")
public String tmplatTitle;
@NotBlank
@Schema(description = "발송 내용")
public String tmplatBody;
@NotBlank
@Schema(description = "발송 내용")
public String tmplatBody;
@Schema(description = "이메일 건당 발송 딜레이(단위 ms, 기본: 500ms)")
public Short delayTime ;
@Schema(description = "이메일 건당 발송 딜레이(단위 ms, 기본: 500ms)")
public Short delayTime;
@Size(max = 16)
@Schema(description = "발송 전화번호(문자 발송에서 사용)")
public String sendTel;
@Size(max = 16)
@Schema(description = "발송 전화번호(문자 발송에서 사용)")
public String sendTel;
@Size(max = 64)
@Email
@Schema(description = "발송 이메일(이메일 발송에서 사용)")
public String sendEml;
@Size(max = 64)
@Email
@Schema(description = "발송 이메일(이메일 발송에서 사용)")
public String sendEml;
@Size(max = 32)
@NotBlank
@Schema(description = "발송자 이름")
public String sendNm;
@Size(max = 32)
@NotBlank
@Schema(description = "발송자 이름")
public String sendNm;
}

View File

@@ -4,13 +4,14 @@ 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;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
@Getter
@Setter
@@ -18,46 +19,46 @@ import java.time.LocalDateTime;
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "템플릿 정보")
public class TemplateDto extends TemplateBasicDto{
public class TemplateDto extends TemplateBasicDto {
@NotNull
@Schema(description = "템플릿 고유 키 (없으면 Create / 있으면 Update)")
public Long tmplatIdx;
@NotNull
@Schema(description = "템플릿 고유 키 (없으면 Create / 있으면 Update)")
public Long tmplatIdx;
@Size(max = 32)
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String regUser;
@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;
@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;
@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;
@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();
}
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

@@ -2,7 +2,11 @@ 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.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@@ -11,16 +15,17 @@ import lombok.*;
@AllArgsConstructor
@Schema(description = "템플릿 요약 정보")
public class TemplateSummaryDto {
@Schema(description = "템플릿 고유 키")
public Long tmplatIdx;
@Schema(description = "템플릿 명")
public String tmplatNm;
@Schema(description = "템플릿 고유 키")
public Long tmplatIdx;
public static TemplateSummaryDto from(TTmplatEntity entity) {
return TemplateSummaryDto.builder()
.tmplatIdx(entity.getTmplatIdx())
.tmplatNm(entity.getTmplatNm())
.build();
}
@Schema(description = "템플릿 명")
public String tmplatNm;
public static TemplateSummaryDto from(TTmplatEntity entity) {
return TemplateSummaryDto.builder()
.tmplatIdx(entity.getTmplatIdx())
.tmplatNm(entity.getTmplatNm())
.build();
}
}