261022_01_ENH: Class에서 record로 변경가능한 Dto들 record로 변경

This commit is contained in:
2026-10-22 10:14:05 +09:00
parent 70ddcdd9c3
commit 645cc71192
87 changed files with 798 additions and 858 deletions

View File

@@ -1,30 +1,25 @@
package com.kri.contact.server.common.external.intranet; package com.kri.contact.server.common.external.intranet;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@Builder @Builder
@NoArgsConstructor // Jackson이 빈 객체를 생성할 수 있도록 추가
@AllArgsConstructor // Builder 패턴 사용 시 필요
@Schema(description = "인트라넷 사용자 검색 응답 DTO") @Schema(description = "인트라넷 사용자 검색 응답 DTO")
public class SearchLoginInfoResponseDto { public record SearchLoginInfoResponseDto(
@Schema(description = "사용자 ID") @Schema(description = "사용자 ID")
private String userId; String userId,
@Schema(description = "사용자 소속 회사") @Schema(description = "사용자 소속 회사")
private String userCmpn; String userCmpn,
@Schema(description = "사용자 이름") @Schema(description = "사용자 이름")
private String userNm; String userNm,
@Schema(description = "사용자 팀") @Schema(description = "사용자 팀")
private String userTeam; String userTeam,
@Schema(description = "사용자 역할") @Schema(description = "사용자 역할")
private int userRole; int userRole
) {
} }

View File

@@ -5,28 +5,34 @@ import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "NotiHubBulkSendCreateRequestDto") @Schema(description = "NotiHubBulkSendCreateRequestDto")
public class NotiHubBulkSendCreateRequestDto { public record NotiHubBulkSendCreateRequestDto(
@Schema(description = "reqstCmpn") @Schema(description = "reqstCmpn")
private String reqstCmpn; String reqstCmpn,
@Schema(description = "reqstUser") @Schema(description = "reqstUser")
private String reqstUser; String reqstUser,
@Schema(description = "reqstSvc") @Schema(description = "reqstSvc")
private String reqstSvc; String reqstSvc,
@Schema(description = "prjctCd") @Schema(description = "prjctCd")
private String prjctCd; String prjctCd,
@Schema(description = "tmplatIdx") @Schema(description = "tmplatIdx")
private Long tmplatIdx; Long tmplatIdx,
@Schema(description = "resve") @Schema(description = "resve")
private Boolean resve; Boolean resve,
@Schema(description = "sendDt") @Schema(description = "sendDt")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime sendDt; LocalDateTime sendDt,
@Schema(description = "trgtCnt") @Schema(description = "trgtCnt")
private Integer trgtCnt; Integer trgtCnt
) {
} }

View File

@@ -3,23 +3,21 @@ package com.kri.contact.server.common.external.notihub.dto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubBulkSendResponseDto") @Schema(description = "NotiHubBulkSendResponseDto")
public class NotiHubBulkSendResponseDto { public record NotiHubBulkSendResponseDto(
@Schema(description = "bulkSendKey") @Schema(description = "bulkSendKey")
private String bulkSendKey; String bulkSendKey,
@Schema(description = "requestCount") @Schema(description = "requestCount")
private Integer requestCount; Integer requestCount,
@Schema(description = "acceptCount") @Schema(description = "acceptCount")
private Integer acceptCount; Integer acceptCount,
@Schema(description = "failCount") @Schema(description = "failCount")
private Integer failCount; Integer failCount
) {
} }

View File

@@ -4,21 +4,24 @@ import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map; import java.util.Map;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "NotiHubDestInfoDto") @Schema(description = "NotiHubDestInfoDto")
public class NotiHubDestInfoDto { public record NotiHubDestInfoDto(
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "destEml") @Schema(description = "destEml")
private String destEml; String destEml,
@Schema(description = "destTel") @Schema(description = "destTel")
private String destTel; String destTel,
@Schema(description = "destNm") @Schema(description = "destNm")
private String destNm; String destNm,
@Schema(description = "msgParam") @Schema(description = "msgParam")
private Map<String, String> msgParam; Map<String, String> msgParam
) {
} }

View File

@@ -3,33 +3,50 @@ package com.kri.contact.server.common.external.notihub.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class NotiHubKkoTemplateDetailDto { public record NotiHubKkoTemplateDetailDto(
private String templateCode; String templateCode,
private String templateName;
private String templateContent; String templateName,
private String templatePreviewMessage;
private String templateMessageType; String templateContent,
private String templateEmphasizeType;
private String inspectionStatus; String templatePreviewMessage,
private String status;
private Boolean block; String templateMessageType,
private Boolean dormant;
private String templateExtra; String templateEmphasizeType,
private String templateImageName;
private String templateImageUrl; String inspectionStatus,
private String templateTitle;
private String templateSubtitle; String status,
private String templateHeader;
private JsonNode templateItemHighlight; Boolean block,
private JsonNode templateItem;
private JsonNode templateRepresentLink; Boolean dormant,
private List<JsonNode> buttons;
private List<JsonNode> quickReplies; 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,12 @@ package com.kri.contact.server.common.external.notihub.dto;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter public record NotiHubKkoTemplateDetailRequestDto(
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class NotiHubKkoTemplateDetailRequestDto {
@NotBlank @NotBlank
@Size(max = 30) @Size(max = 30)
@Pattern(regexp = "[A-Za-z0-9_-]+") @Pattern(regexp = "[A-Za-z0-9_-]+")
private String templateCode; String templateCode
) {
} }

View File

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

View File

@@ -1,19 +1,15 @@
package com.kri.contact.server.common.external.notihub.dto; package com.kri.contact.server.common.external.notihub.dto;
import java.util.List; import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter public record NotiHubKkoTemplateListResponseDto(
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class NotiHubKkoTemplateListResponseDto {
private int totalCount; int totalCount,
private int totalPage;
private int currentPage; int totalPage,
private List<NotiHubKkoTemplateSummaryDto> list;
int currentPage,
List<NotiHubKkoTemplateSummaryDto> list
) {
} }

View File

@@ -1,21 +1,18 @@
package com.kri.contact.server.common.external.notihub.dto; package com.kri.contact.server.common.external.notihub.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 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) @JsonIgnoreProperties(ignoreUnknown = true)
public class NotiHubKkoTemplateSummaryDto { public record NotiHubKkoTemplateSummaryDto(
private String templateCode; String templateCode,
private String templateName;
private String serviceStatus; String templateName,
private String createdAt;
private String modifiedAt; String serviceStatus,
String createdAt,
String modifiedAt
) {
} }

View File

@@ -4,21 +4,24 @@ import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List; import java.util.List;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "NotiHubSendRequestBulkDto") @Schema(description = "NotiHubSendRequestBulkDto")
public class NotiHubSendRequestBulkDto { public record NotiHubSendRequestBulkDto(
@Schema(description = "sendEml") @Schema(description = "sendEml")
private String sendEml; String sendEml,
@Schema(description = "sendTel") @Schema(description = "sendTel")
private String sendTel; String sendTel,
@Schema(description = "sendNm") @Schema(description = "sendNm")
private String sendNm; String sendNm,
@Schema(description = "bulkSendKey") @Schema(description = "bulkSendKey")
private String bulkSendKey; String bulkSendKey,
@Schema(description = "destInfoList") @Schema(description = "destInfoList")
private List<NotiHubDestInfoDto> destInfoList; List<NotiHubDestInfoDto> destInfoList
) {
} }

View File

@@ -4,29 +4,36 @@ import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "NotiHubSendRequestSingleDto") @Schema(description = "NotiHubSendRequestSingleDto")
public class NotiHubSendRequestSingleDto { public record NotiHubSendRequestSingleDto(
@Schema(description = "sendEml") @Schema(description = "sendEml")
private String sendEml; String sendEml,
@Schema(description = "sendTel") @Schema(description = "sendTel")
private String sendTel; String sendTel,
@Schema(description = "sendNm") @Schema(description = "sendNm")
private String sendNm; String sendNm,
@Schema(description = "destInfo") @Schema(description = "destInfo")
private NotiHubDestInfoDto destInfo; NotiHubDestInfoDto destInfo,
@Schema(description = "tmplatIdx") @Schema(description = "tmplatIdx")
private Long tmplatIdx; Long tmplatIdx,
@Schema(description = "reqstSvc") @Schema(description = "reqstSvc")
private String reqstSvc; String reqstSvc,
@Schema(description = "prjctCd") @Schema(description = "prjctCd")
private String prjctCd; String prjctCd,
@Schema(description = "resve") @Schema(description = "resve")
private Boolean resve; Boolean resve,
@Schema(description = "sendDt") @Schema(description = "sendDt")
private LocalDateTime sendDt; LocalDateTime sendDt
) {
} }

View File

@@ -3,32 +3,27 @@ package com.kri.contact.server.common.external.notihub.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubSendResultLastWithSidDto") @Schema(description = "NotiHubSendResultLastWithSidDto")
public class NotiHubSendResultLastWithSidDto { public record NotiHubSendResultLastWithSidDto(
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "lastResultCode") @Schema(description = "lastResultCode")
private Integer lastResultCode; Integer lastResultCode,
@Schema(description = "lastResultLabel") @Schema(description = "lastResultLabel")
private String lastResultLabel; String lastResultLabel,
@Schema(description = "lastResultViewLabel") @Schema(description = "lastResultViewLabel")
private String lastResultViewLabel; String lastResultViewLabel,
@Schema(description = "lastSendDt") @Schema(description = "lastSendDt")
private LocalDateTime lastSendDt; LocalDateTime lastSendDt,
@Schema(description = "totalSendCount") @Schema(description = "totalSendCount")
private Integer totalSendCount; Integer totalSendCount
) {
} }

View File

@@ -3,18 +3,15 @@ package com.kri.contact.server.common.external.notihub.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map; import java.util.Map;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubSendSingleResponseDto") @Schema(description = "NotiHubSendSingleResponseDto")
public class NotiHubSendSingleResponseDto { public record NotiHubSendSingleResponseDto(
@Schema(description = "cmid") @Schema(description = "cmid")
private String cmid; String cmid,
@Schema(description = "data") @Schema(description = "data")
private Map<String, Object> data; Map<String, Object> data
) {
} }

View File

@@ -3,29 +3,30 @@ package com.kri.contact.server.common.external.notihub.dto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubTemplateDto") @Schema(description = "NotiHubTemplateDto")
public class NotiHubTemplateDto { public record NotiHubTemplateDto(
@Schema(description = "tmplatIdx") @Schema(description = "tmplatIdx")
private Long tmplatIdx; Long tmplatIdx,
@Schema(description = "tmplatPurpose") @Schema(description = "tmplatPurpose")
private Integer tmplatPurpose; Integer tmplatPurpose,
@Schema(description = "tmplatTitle") @Schema(description = "tmplatTitle")
private String tmplatTitle; String tmplatTitle,
@Schema(description = "tmplatBody") @Schema(description = "tmplatBody")
private String tmplatBody; String tmplatBody,
@Schema(description = "sendTel") @Schema(description = "sendTel")
private String sendTel; String sendTel,
@Schema(description = "sendEml") @Schema(description = "sendEml")
private String sendEml; String sendEml,
@Schema(description = "sendNm") @Schema(description = "sendNm")
private String sendNm; String sendNm
) {
} }

View File

@@ -1,12 +1,10 @@
package com.kri.contact.server.common.external.shorturl; package com.kri.contact.server.common.external.shorturl;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter public record ShortUrlCreateRequestDto(
@AllArgsConstructor
public class ShortUrlCreateRequestDto {
private String orgUrl; String orgUrl,
private boolean useParam;
boolean useParam
) {
} }

View File

@@ -35,7 +35,7 @@ public class AuthController {
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime(); final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
LoginResponseDto response = authService.tryLogin(request); LoginResponseDto response = authService.tryLogin(request);
systemEventLogService.writeLoginLog(response.getUser().getUserId(), now, ctx.getClientIp()); systemEventLogService.writeLoginLog(response.user().getUserId(), now, ctx.getClientIp());
return response; return response;
} }

View File

@@ -101,7 +101,7 @@ public class ListController {
) { ) {
getProjectOrThrow(prjctIdx); getProjectOrThrow(prjctIdx);
ListUploadFileInfoDto uploadFile = listUploadService.downloadUploadFile(prjctIdx, listUploadLogId); ListUploadFileInfoDto uploadFile = listUploadService.downloadUploadFile(prjctIdx, listUploadLogId);
return buildExcelResponse(uploadFile.getFileName(), uploadFile.getBytes()); return buildExcelResponse(uploadFile.fileName(), uploadFile.bytes());
} }
@Operation(summary = "리스트 수정") @Operation(summary = "리스트 수정")
@@ -147,7 +147,7 @@ public class ListController {
) { ) {
getProjectOrThrow(prjctIdx); getProjectOrThrow(prjctIdx);
ListUploadFileInfoDto file = listDownloadService.downloadItemFile(prjctIdx, sid, listHderId); ListUploadFileInfoDto file = listDownloadService.downloadItemFile(prjctIdx, sid, listHderId);
return buildFileResponse(file.getFileName(), file.getBytes()); return buildFileResponse(file.fileName(), file.bytes());
} }
private ProjectInfoDto getProjectOrThrow(Long prjctIdx) { private ProjectInfoDto getProjectOrThrow(Long prjctIdx) {

View File

@@ -58,8 +58,8 @@ public class ListHistoryController {
@Valid @RequestBody ListEventHistFromSurveyDto request, @Valid @RequestBody ListEventHistFromSurveyDto request,
RequestUserContext ctx RequestUserContext ctx
) { ) {
if (request.getMeta().getRemoteAddr() == null) { if (request.meta().getRemoteAddr() == null) {
request.getMeta().setRemoteAddr(ctx.getClientIp()); request.meta().setRemoteAddr(ctx.getClientIp());
} }
String regUser = resolveRegUser(request, ctx); String regUser = resolveRegUser(request, ctx);
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime(); final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
@@ -103,7 +103,7 @@ public class ListHistoryController {
if (ctx.getUserId() != null) { if (ctx.getUserId() != null) {
return ctx.getUserId(); return ctx.getUserId();
} }
ListEventHistSurveyMetaDto meta = request.getMeta(); ListEventHistSurveyMetaDto meta = request.meta();
if (meta != null && meta.getEntryType() != null) { if (meta != null && meta.getEntryType() != null) {
return meta.getEntryType().name(); return meta.getEntryType().name();
} }

View File

@@ -116,10 +116,10 @@ public class ProjectController {
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime(); final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
String newHtml = contactScenarioFileService.syncOnSave( String newHtml = contactScenarioFileService.syncOnSave(
req.getProjectInfo().getPrjctCd(), req.projectInfo().getPrjctCd(),
req.getProjectInfo().getContactSenario() req.projectInfo().getContactSenario()
); );
req.getProjectInfo().setContactSenario(newHtml); req.projectInfo().setContactSenario(newHtml);
projectService.updateProject(prjctIdx, req, ctx.getUserId(), now, ctx); projectService.updateProject(prjctIdx, req, ctx.getUserId(), now, ctx);

View File

@@ -2,14 +2,15 @@ package com.kri.contact.server.dto.assign;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "외주사별 리스트 배정 현황") @Schema(description = "외주사별 리스트 배정 현황")
public class CompanyAssignSummaryItemDto { public record CompanyAssignSummaryItemDto(
private String cmpnId; String cmpnId,
private String cmpnAlias;
private long assignedCount; String cmpnAlias,
long assignedCount
) {
} }

View File

@@ -2,15 +2,17 @@ package com.kri.contact.server.dto.assign;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "필드워커별 리스트 배정 현황") @Schema(description = "필드워커별 리스트 배정 현황")
public class FieldworkAssignSummaryItemDto { public record FieldworkAssignSummaryItemDto(
private String userId; String userId,
private String userName;
private String userCmpn; String userName,
private long assignedCount;
String userCmpn,
long assignedCount
) {
} }

View File

@@ -3,14 +3,15 @@ package com.kri.contact.server.dto.assign;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List; import java.util.List;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "프로젝트 외주사 리스트 배정 요약") @Schema(description = "프로젝트 외주사 리스트 배정 요약")
public class ProjectCompanyAssignSummaryDto { public record ProjectCompanyAssignSummaryDto(
private long totalCount; long totalCount,
private long unassignedCount;
private List<CompanyAssignSummaryItemDto> assignees; long unassignedCount,
List<CompanyAssignSummaryItemDto> assignees
) {
} }

View File

@@ -3,14 +3,15 @@ package com.kri.contact.server.dto.assign;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List; import java.util.List;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "프로젝트 필드워커 리스트 배정 요약") @Schema(description = "프로젝트 필드워커 리스트 배정 요약")
public class ProjectFieldworkAssignSummaryDto { public record ProjectFieldworkAssignSummaryDto(
private long totalCount; long totalCount,
private long unassignedCount;
private List<FieldworkAssignSummaryItemDto> assignees; long unassignedCount,
List<FieldworkAssignSummaryItemDto> assignees
) {
} }

View File

@@ -1,17 +1,19 @@
package com.kri.contact.server.dto.auth; package com.kri.contact.server.dto.auth;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "사용자 로그인 요청") @Schema(description = "사용자 로그인 요청")
public class LoginRequestDto { public record LoginRequestDto(
@Schema(description = "사용자 ID") @Schema(description = "사용자 ID")
private String userId; String userId,
@Schema(description = "사용자 PW") @Schema(description = "사용자 PW")
private String userPw; String userPw
) {
@Override
public String toString() {
return "LoginRequestDto[redacted]";
}
} }

View File

@@ -4,18 +4,17 @@ package com.kri.contact.server.dto.auth;
import com.kri.common.feature.auth.dto.JwtUserClaimsDto; import com.kri.common.feature.auth.dto.JwtUserClaimsDto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "로그인 응답") @Schema(description = "로그인 응답")
public class LoginResponseDto { public record LoginResponseDto(
@Schema(description = "jwt access 토큰") @Schema(description = "jwt access 토큰")
private String accessToken; String accessToken,
@Schema(description = "사용자 정보") @Schema(description = "사용자 정보")
private JwtUserClaimsDto user; JwtUserClaimsDto user
) {
public static LoginResponseDto from(String accessToken, JwtUserClaimsDto jwtUserClaims) { public static LoginResponseDto from(String accessToken, JwtUserClaimsDto jwtUserClaims) {
return LoginResponseDto.builder() return LoginResponseDto.builder()
@@ -23,4 +22,9 @@ public class LoginResponseDto {
.user(jwtUserClaims) .user(jwtUserClaims)
.build(); .build();
} }
@Override
public String toString() {
return "LoginResponseDto[redacted]";
}
} }

View File

@@ -7,58 +7,51 @@ import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "회사 정보") @Schema(description = "회사 정보")
public class CmpnInfoDto { public record CmpnInfoDto(
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@Schema(description = "회사 id(회사이름)") @Schema(description = "회사 id(회사이름)")
private String cmpnId; String cmpnId,
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@Schema(description = "회사 별칭") @Schema(description = "회사 별칭")
private String cmpnAlias; String cmpnAlias,
@Size(max = 16) @Size(max = 16)
@Schema(description = "회사 전화번호") @Schema(description = "회사 전화번호")
private String cmpnTel; String cmpnTel,
@NotNull @NotNull
@Schema(description = "자사 여부") @Schema(description = "자사 여부")
private Boolean ownCmpn; Boolean ownCmpn,
@Schema(description = "메모") @Schema(description = "메모")
private String memo; String memo,
@Size(max = 32) @Size(max = 32)
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String regUser; String regUser,
@Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime regDt; LocalDateTime regDt,
@Size(max = 32) @Size(max = 32)
@Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String modUser; String modUser,
@Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime modDt; LocalDateTime modDt
) {
public static CmpnInfoDto from(TCmpnEntity entity) { public static CmpnInfoDto from(TCmpnEntity entity) {
return CmpnInfoDto.builder() return CmpnInfoDto.builder()

View File

@@ -1,30 +1,40 @@
package com.kri.contact.server.dto.common; package com.kri.contact.server.dto.common;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@AllArgsConstructor @JsonDeserialize(builder = DataVerificationDto.JsonBuilder.class)
@Schema(description = "데이터 검증에 대한 공용 Dto") @Schema(description = "데이터 검증에 대한 공용 Dto")
public class DataVerificationDto { public record DataVerificationDto(
@Schema(description = "데이터 검증 통과 여부") @Schema(description = "데이터 검증 통과 여부")
private boolean success; boolean success,
@Schema(description = "검증 필드명") @Schema(description = "검증 필드명")
private String fieldName; String fieldName,
@Schema(description = "검증 메시지(error)") @Schema(description = "검증 메시지(error)")
private String errMessage; String errMessage
) {
public DataVerificationDto() { public DataVerificationDto() {
this.success = true; this(true, "", "");
this.fieldName = ""; }
this.errMessage = "";
@JsonPOJOBuilder(withPrefix = "")
public static class JsonBuilder {
@JsonSetter(nulls = Nulls.AS_EMPTY)
public boolean success = true;
public String fieldName = "";
public String errMessage = "";
public DataVerificationDto build() {
return new DataVerificationDto(success, fieldName, errMessage);
}
} }
} }

View File

@@ -2,22 +2,16 @@ package com.kri.contact.server.dto.common;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "날짜 범위 Dto") @Schema(description = "날짜 범위 Dto")
public class DateRangeDto { public record DateRangeDto(
@Schema(description = "시작 날짜") @Schema(description = "시작 날짜")
private LocalDateTime startDate; LocalDateTime startDate,
@Schema(description = "종료 날짜") @Schema(description = "종료 날짜")
private LocalDateTime endDate; LocalDateTime endDate
) {
} }

View File

@@ -2,32 +2,29 @@ package com.kri.contact.server.dto.excel;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@Schema(description = "ExcelUploadResultDto") @Schema(description = "ExcelUploadResultDto")
public class ExcelUploadResultDto { public record ExcelUploadResultDto(
@Schema(description = "전체 읽은 행 수 (헤더 제외)") @Schema(description = "전체 읽은 행 수 (헤더 제외)")
private int totalCount; int totalCount,
@Schema(description = "DB에 실제로 insert/update 성공한 개수") @Schema(description = "DB에 실제로 insert/update 성공한 개수")
private int successCount; int successCount,
@Schema(description = "실패(에러) 개수") @Schema(description = "실패(에러) 개수")
private int failCount; int failCount,
@Schema(description = "에러 엑셀 파일이 있는지 여부") @Schema(description = "에러 엑셀 파일이 있는지 여부")
private boolean hasErrorFile; boolean hasErrorFile,
@Schema(description = "프론트가 저장용으로 쓸 파일명") @Schema(description = "프론트가 저장용으로 쓸 파일명")
private String errorFileName; String errorFileName,
@Schema(description = "에러 엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)") @Schema(description = "에러 엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)")
private String errorFileBase64; String errorFileBase64
) {
public static ExcelUploadResultDto success(int totalCount, int successCount) { public static ExcelUploadResultDto success(int totalCount, int successCount) {
return ExcelUploadResultDto.builder() return ExcelUploadResultDto.builder()
@@ -37,5 +34,4 @@ public class ExcelUploadResultDto {
.hasErrorFile(false) .hasErrorFile(false)
.build(); .build();
} }
} }

View File

@@ -6,28 +6,23 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.AssertTrue; import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "마지막 이벤트 일자 필터 조건") @Schema(description = "마지막 이벤트 일자 필터 조건")
public class LastEventDateRangeDto { public record LastEventDateRangeDto(
@NotNull @NotNull
@Schema(description = "결과 코드 타입") @Schema(description = "결과 코드 타입")
private ResultCodeType resultCodeType; ResultCodeType resultCodeType,
@Schema(description = "프로젝트 설문 고유번호. SURVEY 타입인 경우 필수") @Schema(description = "프로젝트 설문 고유번호. SURVEY 타입인 경우 필수")
private Long prjctSurveyIdx; Long prjctSurveyIdx,
@Schema(description = "시작 일시") @Schema(description = "시작 일시")
private LocalDateTime startDate; LocalDateTime startDate,
@Schema(description = "종료 일시") @Schema(description = "종료 일시")
private LocalDateTime endDate; LocalDateTime endDate
) {
@JsonIgnore @JsonIgnore
@AssertTrue(message = "SURVEY 타입은 prjctSurveyIdx가 필요합니다.") @AssertTrue(message = "SURVEY 타입은 prjctSurveyIdx가 필요합니다.")

View File

@@ -5,53 +5,71 @@ import com.kri.contact.server.persistence.entity.TListCallHistEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "ListCallHistDto") @Schema(description = "ListCallHistDto")
public class ListCallHistDto { public record ListCallHistDto(
@Schema(description = "listCallHistIdx") @Schema(description = "listCallHistIdx")
private Long listCallHistIdx; Long listCallHistIdx,
@Schema(description = "prjctIdx") @Schema(description = "prjctIdx")
private Long prjctIdx; Long prjctIdx,
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "listHderId") @Schema(description = "listHderId")
private Integer listHderId; Integer listHderId,
@Schema(description = "destNum") @Schema(description = "destNum")
private String destNum; String destNum,
@Schema(description = "agentNum") @Schema(description = "agentNum")
private String agentNum; String agentNum,
@Schema(description = "aniNum") @Schema(description = "aniNum")
private String aniNum; String aniNum,
@Schema(description = "agentSessionId") @Schema(description = "agentSessionId")
private String agentSessionId; String agentSessionId,
@Schema(description = "destSessionId") @Schema(description = "destSessionId")
private String destSessionId; String destSessionId,
@Schema(description = "callTy") @Schema(description = "callTy")
private String callTy; String callTy,
@Schema(description = "callStatus") @Schema(description = "callStatus")
private CallStatus callStatus; CallStatus callStatus,
@Schema(description = "startDt") @Schema(description = "startDt")
private LocalDateTime startDt; LocalDateTime startDt,
@Schema(description = "endDt") @Schema(description = "endDt")
private LocalDateTime endDt; LocalDateTime endDt,
@Schema(description = "totalTime") @Schema(description = "totalTime")
private Integer totalTime; Integer totalTime,
@Schema(description = "talkTime") @Schema(description = "talkTime")
private Integer talkTime; Integer talkTime,
@Schema(description = "mediaServerId") @Schema(description = "mediaServerId")
private Integer mediaServerId; Integer mediaServerId,
@Schema(description = "mediaServerName") @Schema(description = "mediaServerName")
private String mediaServerName; String mediaServerName,
@Schema(description = "recordFileName") @Schema(description = "recordFileName")
private String recordFileName; String recordFileName,
@Schema(description = "regUser") @Schema(description = "regUser")
private String regUser; String regUser,
@Schema(description = "regDt") @Schema(description = "regDt")
private LocalDateTime regDt; LocalDateTime regDt
) {
public static ListCallHistDto from(TListCallHistEntity entity) { public static ListCallHistDto from(TListCallHistEntity entity) {
return ListCallHistDto.builder() return ListCallHistDto.builder()

View File

@@ -9,37 +9,32 @@ import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "리스트 + 컨택이력 다운로드 요청 DTO") @Schema(description = "리스트 + 컨택이력 다운로드 요청 DTO")
public class ListEventHistDownloadRequestDto { public record ListEventHistDownloadRequestDto(
@Valid @Valid
@NotNull @NotNull
@Schema(description = "리스트 필터") @Schema(description = "리스트 필터")
private ListFilterDto listFilter; ListFilterDto listFilter,
@NotEmpty @NotEmpty
@Schema(description = "조회할 ResultCodeType 목록") @Schema(description = "조회할 ResultCodeType 목록")
private List<ResultCodeType> resultCodeTypes; List<ResultCodeType> resultCodeTypes,
@NotNull @NotNull
@Schema(description = "조회 기준") @Schema(description = "조회 기준")
private ListEventHistoryBase searchBase; ListEventHistoryBase searchBase,
@Schema(description = "이력 정렬 순서. ASC=오래된 이력 우선, DESC=최근 이력 우선", defaultValue = "ASC") @Schema(description = "이력 정렬 순서. ASC=오래된 이력 우선, DESC=최근 이력 우선", defaultValue = "ASC")
private ListEventHistoryOrder historyOrder = ListEventHistoryOrder.ASC; ListEventHistoryOrder historyOrder,
@Valid @Valid
@Schema(description = "조회 기간") @Schema(description = "조회 기간")
private DateRangeDto dateRange; DateRangeDto dateRange
) {
public ListEventHistoryOrder getHistoryOrder() { public ListEventHistoryOrder historyOrder() {
return historyOrder == null ? ListEventHistoryOrder.ASC : historyOrder; return historyOrder == null ? ListEventHistoryOrder.ASC : historyOrder;
} }
} }

View File

@@ -4,30 +4,25 @@ import com.kri.contact.server.common.enums.ListEventHistorySurveyType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "설문 결과 입력 DTO") @Schema(description = "설문 결과 입력 DTO")
public class ListEventHistFromSurveyDto { public record ListEventHistFromSurveyDto(
@NotNull @NotNull
@Schema(description = "설문 action 코드") @Schema(description = "설문 action 코드")
private ListEventHistorySurveyType action; ListEventHistorySurveyType action,
@NotNull @NotNull
@Schema(description = "프로젝트 설문 고유번호") @Schema(description = "프로젝트 설문 고유번호")
private Long prjctSurveyIdx; Long prjctSurveyIdx,
@NotNull @NotNull
@Schema(description = "리스트 고유번호") @Schema(description = "리스트 고유번호")
private String sid; String sid,
@NotNull @NotNull
@Valid @Valid
@Schema(description = "메타 데이터") @Schema(description = "메타 데이터")
private ListEventHistSurveyMetaDto meta; ListEventHistSurveyMetaDto meta
) {
} }

View File

@@ -4,40 +4,35 @@ import com.kri.contact.server.common.enums.ResultCodeType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "내부 리스트 이벤트 이력 추가 요청 DTO") @Schema(description = "내부 리스트 이벤트 이력 추가 요청 DTO")
public class ListEventHistInsertRequestDto { public record ListEventHistInsertRequestDto(
@NotNull @NotNull
@Schema(description = "프로젝트 고유 번호") @Schema(description = "프로젝트 고유 번호")
private Long prjctIdx; Long prjctIdx,
@NotNull @NotNull
@Schema(description = "리스트 고유 번호") @Schema(description = "리스트 고유 번호")
private String sid; String sid,
@NotNull @NotNull
@Schema(description = "결과 코드 타입") @Schema(description = "결과 코드 타입")
private ResultCodeType resultCodeType; ResultCodeType resultCodeType,
@NotNull @NotNull
@Schema(description = "결과 코드") @Schema(description = "결과 코드")
private Integer resultCd; Integer resultCd,
@Schema(description = "전화 이력 id") @Schema(description = "전화 이력 id")
private Long listCallHistIdx; Long listCallHistIdx,
@Valid @Valid
@Schema(description = "메타 데이터") @Schema(description = "메타 데이터")
private ListEventHistInternalMetaDto meta; ListEventHistInternalMetaDto meta,
@NotNull @NotNull
@Schema(description = "사용자 메모") @Schema(description = "사용자 메모")
private String memo; String memo
) {
} }

View File

@@ -1,55 +1,32 @@
package com.kri.contact.server.dto.list; package com.kri.contact.server.dto.list;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "ListEventHistInternalMetaDto") @Schema(description = "ListEventHistInternalMetaDto")
public class ListEventHistInternalMetaDto { public record ListEventHistInternalMetaDto(
@Schema(description = "GPS 위도") @Schema(description = "GPS 위도")
private Double latitude; Double latitude,
@Schema(description = "GPS 경도") @Schema(description = "GPS 경도")
private Double longitude; Double longitude,
@Schema(description = "GPS 위치 정확도(미터)") @Schema(description = "GPS 위치 정확도(미터)")
private Double accuracy; Double accuracy,
@Schema(description = "요청 클라이언트 IP 주소") @Schema(description = "요청 클라이언트 IP 주소")
private String remoteAddr;
@Builder(access = AccessLevel.PRIVATE)
private ListEventHistInternalMetaDto(
Double latitude,
Double longitude,
Double accuracy,
String remoteAddr String remoteAddr
) { ) {
this.latitude = latitude;
this.longitude = longitude;
this.accuracy = accuracy;
this.remoteAddr = remoteAddr;
}
public static ListEventHistInternalMetaDto withRemoteAddr( public static ListEventHistInternalMetaDto withRemoteAddr(
ListEventHistInternalMetaDto meta, ListEventHistInternalMetaDto meta,
String remoteAddr String remoteAddr
) { ) {
if (meta == null) { return new ListEventHistInternalMetaDto(
meta = new ListEventHistInternalMetaDto(); meta == null ? null : meta.latitude(),
} meta == null ? null : meta.longitude(),
return ListEventHistInternalMetaDto.builder() meta == null ? null : meta.accuracy(),
.latitude(meta.getLatitude()) remoteAddr
.longitude(meta.getLongitude()) );
.accuracy(meta.getAccuracy())
.remoteAddr(remoteAddr)
.build();
} }
} }

View File

@@ -4,35 +4,44 @@ import com.kri.contact.server.persistence.entity.TListEventHistEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "ListEventHistoryDto") @Schema(description = "ListEventHistoryDto")
public class ListEventHistoryDto { public record ListEventHistoryDto(
@Schema(description = "listEventHistIdx") @Schema(description = "listEventHistIdx")
private Long listEventHistIdx; Long listEventHistIdx,
@Schema(description = "eventTy") @Schema(description = "eventTy")
private Short eventTy; Short eventTy,
@Schema(description = "prjctIdx") @Schema(description = "prjctIdx")
private Long prjctIdx; Long prjctIdx,
@Schema(description = "prjctSurveyIdx") @Schema(description = "prjctSurveyIdx")
private Long prjctSurveyIdx; Long prjctSurveyIdx,
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "resultCd") @Schema(description = "resultCd")
private Integer resultCd; Integer resultCd,
@Schema(description = "metaData") @Schema(description = "metaData")
private String metaData; String metaData,
@Schema(description = "listCallHistIdx") @Schema(description = "listCallHistIdx")
private Long listCallHistIdx; Long listCallHistIdx,
@Schema(description = "memo") @Schema(description = "memo")
private String memo; String memo,
@Schema(description = "regUser") @Schema(description = "regUser")
private String regUser; String regUser,
@Schema(description = "regDt") @Schema(description = "regDt")
private LocalDateTime regDt; LocalDateTime regDt
) {
public static ListEventHistoryDto from(TListEventHistEntity entity) { public static ListEventHistoryDto from(TListEventHistEntity entity) {
return ListEventHistoryDto.builder() return ListEventHistoryDto.builder()

View File

@@ -2,25 +2,19 @@ package com.kri.contact.server.dto.list;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map; import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "외부에서 리스트 조회") @Schema(description = "외부에서 리스트 조회")
public class ListSearchExternalDto { public record ListSearchExternalDto(
@Schema(description = "프로젝트 코드") @Schema(description = "프로젝트 코드")
private String prjctCd; String prjctCd,
@Schema(description = "SID") @Schema(description = "SID")
private String sid; String sid,
@Schema(description = "리스트 값 정보(헤더 네임 기반)") @Schema(description = "리스트 값 정보(헤더 네임 기반)")
private Map<String, String> itemList; Map<String, String> itemList
) {
} }

View File

@@ -4,28 +4,21 @@ import com.kri.common.feature.web.page.PageRequestDto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "리스트 검색 조건") @Schema(description = "리스트 검색 조건")
public class ListSearchRequestDto { public record ListSearchRequestDto(
@Valid @Valid
@NotNull @NotNull
@Schema(description = "리스트 필터") @Schema(description = "리스트 필터")
private ListFilterDto listFilter; ListFilterDto listFilter,
@NotNull @NotNull
@Schema(description = "페이지네이션 정보") @Schema(description = "페이지네이션 정보")
private PageRequestDto pageRequest; PageRequestDto pageRequest
) {
public static ListSearchRequestDto of(ListFilterDto listFilter, PageRequestDto pageRequest){ public static ListSearchRequestDto of(ListFilterDto listFilter, PageRequestDto pageRequest){
return ListSearchRequestDto.builder() return ListSearchRequestDto.builder()

View File

@@ -28,11 +28,11 @@ public class ListSendResultDto extends ListResultBaseDto {
} }
return ListSendResultDto.builder() return ListSendResultDto.builder()
.lastResultCd(dto.getLastResultCode() == null ? null : dto.getLastResultCode().shortValue()) .lastResultCd(dto.lastResultCode() == null ? null : dto.lastResultCode().shortValue())
.lastResultDt(dto.getLastSendDt()) .lastResultDt(dto.lastSendDt())
.attemptCount(dto.getTotalSendCount()) .attemptCount(dto.totalSendCount())
.lastResultLabel(dto.getLastResultLabel()) .lastResultLabel(dto.lastResultLabel())
.lastResultViewLabel(dto.getLastResultViewLabel()) .lastResultViewLabel(dto.lastResultViewLabel())
.build(); .build();
} }
} }

View File

@@ -4,21 +4,16 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.Set; import java.util.Set;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "설문별 결과 필터 조건") @Schema(description = "설문별 결과 필터 조건")
public class ListSurveyResultFilterConditionDto { public record ListSurveyResultFilterConditionDto(
@NotNull @NotNull
@Schema(description = "프로젝트 설문 고유번호") @Schema(description = "프로젝트 설문 고유번호")
private Long prjctSurveyIdx; Long prjctSurveyIdx,
@NotEmpty @NotEmpty
@Schema(description = "설문 결과 코드 목록") @Schema(description = "설문 결과 코드 목록")
private Set<Integer> resultCodes; Set<Integer> resultCodes
) {
} }

View File

@@ -2,21 +2,16 @@ package com.kri.contact.server.dto.list;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "설문 결과 수정 내용") @Schema(description = "설문 결과 수정 내용")
public class ListSurveyResultUpdateDto { public record ListSurveyResultUpdateDto(
@NotNull @NotNull
@Schema(description = "프로젝트 설문 고유번호") @Schema(description = "프로젝트 설문 고유번호")
private Long prjctSurveyIdx; Long prjctSurveyIdx,
@NotNull @NotNull
@Schema(description = "설문 결과 코드") @Schema(description = "설문 결과 코드")
private Integer resultCd; Integer resultCd
) {
} }

View File

@@ -5,29 +5,35 @@ import io.swagger.v3.oas.annotations.media.Schema;
import com.kri.contact.server.persistence.entity.TListUpdateHistEntity; import com.kri.contact.server.persistence.entity.TListUpdateHistEntity;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "ListUpdateHistoryDto") @Schema(description = "ListUpdateHistoryDto")
public class ListUpdateHistoryDto { public record ListUpdateHistoryDto(
@Schema(description = "listUpdateHistIdx") @Schema(description = "listUpdateHistIdx")
private Long listUpdateHistIdx; Long listUpdateHistIdx,
@Schema(description = "prjctIdx") @Schema(description = "prjctIdx")
private Long prjctIdx; Long prjctIdx,
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "listHderId") @Schema(description = "listHderId")
private Integer listHderId; Integer listHderId,
@Schema(description = "beforeVal") @Schema(description = "beforeVal")
private String beforeVal; String beforeVal,
@Schema(description = "afterVal") @Schema(description = "afterVal")
private String afterVal; String afterVal,
@Schema(description = "regUser") @Schema(description = "regUser")
private String regUser; String regUser,
@Schema(description = "regDt") @Schema(description = "regDt")
private LocalDateTime regDt; LocalDateTime regDt
) {
public static ListUpdateHistoryDto from(TListUpdateHistEntity entity) { public static ListUpdateHistoryDto from(TListUpdateHistEntity entity) {
return ListUpdateHistoryDto.builder() return ListUpdateHistoryDto.builder()

View File

@@ -2,16 +2,15 @@ package com.kri.contact.server.dto.list;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "리스트 업로드 파일 정보") @Schema(description = "리스트 업로드 파일 정보")
public class ListUploadFileInfoDto { public record ListUploadFileInfoDto(
@Schema(description = "파일명") @Schema(description = "파일명")
private String fileName; String fileName,
@Schema(description = "파일 바이트") @Schema(description = "파일 바이트")
private byte[] bytes; byte[] bytes
) {
} }

View File

@@ -5,36 +5,35 @@ import com.kri.contact.server.persistence.entity.TListUploadLogEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "리스트 업로드 이력") @Schema(description = "리스트 업로드 이력")
public class ListUploadHistoryDto { public record ListUploadHistoryDto(
@Schema(description = "리스트 업로드 로그 ID") @Schema(description = "리스트 업로드 로그 ID")
private String listUploadLogId; String listUploadLogId,
@Schema(description = "업로드 차수") @Schema(description = "업로드 차수")
private Integer wave; Integer wave,
@Schema(description = "업로드 파일명") @Schema(description = "업로드 파일명")
private String fileName; String fileName,
@Schema(description = "업로드 리스트 수") @Schema(description = "업로드 리스트 수")
private Integer listCount; Integer listCount,
@Schema(description = "업로드 모드") @Schema(description = "업로드 모드")
private ListUploadMode uploadMode; ListUploadMode uploadMode,
@Schema(description = "등록 사용자") @Schema(description = "등록 사용자")
private String regUser; String regUser,
@Schema(description = "등록 일시") @Schema(description = "등록 일시")
private LocalDateTime regDt; LocalDateTime regDt,
@Schema(description = "업로드 파일 자동삭제 일시") @Schema(description = "업로드 파일 자동삭제 일시")
private LocalDateTime schedulingDelDt; LocalDateTime schedulingDelDt
) {
public static ListUploadHistoryDto fromEntity(TListUploadLogEntity entity) { public static ListUploadHistoryDto fromEntity(TListUploadLogEntity entity) {
return ListUploadHistoryDto.builder() return ListUploadHistoryDto.builder()

View File

@@ -5,26 +5,21 @@ import com.kri.contact.server.common.enums.ListUploadMode;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.Map; import java.util.Map;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "리스트 업로드 요청 DTO") @Schema(description = "리스트 업로드 요청 DTO")
public class ListUploadRequestDto { public record ListUploadRequestDto(
@NotNull @NotNull
@Schema(description = "업로드 모드") @Schema(description = "업로드 모드")
private ListUploadMode uploadMode; ListUploadMode uploadMode,
@Schema(description = "이메일 중복 체크") @Schema(description = "이메일 중복 체크")
private boolean checkDuplicateEmail; boolean checkDuplicateEmail,
@Schema(description = "전화번호 중복 체크") @Schema(description = "전화번호 중복 체크")
private boolean checkDuplicatePhone; boolean checkDuplicatePhone,
@Schema(description = "특수 헤더 정보") @Schema(description = "특수 헤더 정보")
private Map<String, ListHeaderTypeSpecific> specificHeader; Map<String, ListHeaderTypeSpecific> specificHeader
) {
} }

View File

@@ -3,21 +3,24 @@ package com.kri.contact.server.dto.message;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "MessageFailedChunkDto") @Schema(description = "MessageFailedChunkDto")
public class MessageFailedChunkDto { public record MessageFailedChunkDto(
@Schema(description = "chunkIndex") @Schema(description = "chunkIndex")
private int chunkIndex; int chunkIndex,
@Schema(description = "from") @Schema(description = "from")
private int from; int from,
@Schema(description = "to") @Schema(description = "to")
private int to; int to,
@Schema(description = "targetCount") @Schema(description = "targetCount")
private int targetCount; int targetCount,
@Schema(description = "errorMessage") @Schema(description = "errorMessage")
private String errorMessage; String errorMessage
) {
} }

View File

@@ -1,6 +1,8 @@
package com.kri.contact.server.dto.message; package com.kri.contact.server.dto.message;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.kri.contact.server.dto.list.ListFilterDto; import com.kri.contact.server.dto.list.ListFilterDto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -8,39 +10,35 @@ import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "Message bulk send request") @Schema(description = "Message bulk send request")
public class MessageSendBulkRequestDto { public record MessageSendBulkRequestDto(
@NotNull @NotNull
@Schema(description = "템플릿 고유 번호", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "템플릿 고유 번호", requiredMode = Schema.RequiredMode.REQUIRED)
private Long tmplatIdx; Long tmplatIdx,
@NotNull @NotNull
@Schema(description = "예약 발송 여부", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "예약 발송 여부", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean resve; Boolean resve,
@Schema(description = "예약 발송 일시") @Schema(description = "예약 발송 일시")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime sendDt; LocalDateTime sendDt,
@Valid @Valid
@Schema(description = "리스트 필터") @Schema(description = "리스트 필터")
private ListFilterDto listFilter; ListFilterDto listFilter,
@NotEmpty @NotEmpty
@Schema(description = "수신처로 사용할 리스트 헤더 ID 목록", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "수신처로 사용할 리스트 헤더 ID 목록", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Integer> destHeaderIds; List<Integer> destHeaderIds,
@Schema(description = "수신자 이름으로 사용할 리스트 헤더 ID") @Schema(description = "수신자 이름으로 사용할 리스트 헤더 ID")
private Integer destNameHeaderId; Integer destNameHeaderId,
@Schema(description = "수신처 중복 제거 여부", defaultValue = "false") @Schema(description = "수신처 중복 제거 여부", defaultValue = "false")
private Boolean dedupe = false; @JsonSetter(nulls = Nulls.AS_EMPTY)
boolean dedupe
) {
} }

View File

@@ -5,24 +5,45 @@ import io.swagger.v3.oas.annotations.media.Schema;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "MessageBulkSendResponseDto") @Schema(description = "MessageBulkSendResponseDto")
public class MessageSendBulkResponseDto { public record MessageSendBulkResponseDto(
@Schema(description = "bulkSendKey") @Schema(description = "bulkSendKey")
private String bulkSendKey; String bulkSendKey,
@Schema(description = "targetCount") @Schema(description = "targetCount")
private int targetCount; int targetCount,
@Schema(description = "requestCount") @Schema(description = "requestCount")
private int requestCount; int requestCount,
@Schema(description = "acceptCount") @Schema(description = "acceptCount")
private int acceptCount; int acceptCount,
@Schema(description = "failCount") @Schema(description = "failCount")
private int failCount; int failCount,
@Builder.Default
@Schema(description = "failedChunks") @Schema(description = "failedChunks")
private List<MessageFailedChunkDto> failedChunks = new ArrayList<>(); List<MessageFailedChunkDto> failedChunks
) {
public static class MessageSendBulkResponseDtoBuilder {
private boolean failedChunksSet;
private List<MessageFailedChunkDto> failedChunks;
public MessageSendBulkResponseDtoBuilder failedChunks(List<MessageFailedChunkDto> failedChunks) {
this.failedChunks = failedChunks;
this.failedChunksSet = true;
return this;
}
public MessageSendBulkResponseDto build() {
return new MessageSendBulkResponseDto(
bulkSendKey, targetCount, requestCount, acceptCount, failCount,
failedChunksSet ? failedChunks : new ArrayList<>()
);
}
}
} }

View File

@@ -6,36 +6,31 @@ import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "Message single send request") @Schema(description = "Message single send request")
public class MessageSendSingleRequestDto { public record MessageSendSingleRequestDto(
@NotNull @NotNull
@Schema(description = "tmplatIdx") @Schema(description = "tmplatIdx")
private Long tmplatIdx; Long tmplatIdx,
@NotNull @NotNull
@Schema(description = "resve") @Schema(description = "resve")
private Boolean resve; Boolean resve,
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "sendDt") @Schema(description = "sendDt")
private LocalDateTime sendDt; LocalDateTime sendDt,
@NotNull @NotNull
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@NotEmpty @NotEmpty
@Schema(description = "destHeaderIds") @Schema(description = "destHeaderIds")
private List<Integer> destHeaderIds; List<Integer> destHeaderIds,
@Schema(description = "destNameHeaderId") @Schema(description = "destNameHeaderId")
private Integer destNameHeaderId; Integer destNameHeaderId
) {
} }

View File

@@ -4,23 +4,22 @@ import com.kri.contact.server.common.external.notihub.dto.NotiHubSendSingleRespo
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map; import java.util.Map;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "Message single send response") @Schema(description = "Message single send response")
public class MessageSendSingleResponseDto { public record MessageSendSingleResponseDto(
@Schema(description = "cmid") @Schema(description = "cmid")
private String cmid; String cmid,
@Schema(description = "data") @Schema(description = "data")
private Map<String, Object> data; Map<String, Object> data
) {
public static MessageSendSingleResponseDto from(NotiHubSendSingleResponseDto response) { public static MessageSendSingleResponseDto from(NotiHubSendSingleResponseDto response) {
return MessageSendSingleResponseDto.builder() return MessageSendSingleResponseDto.builder()
.cmid(response.getCmid()) .cmid(response.cmid())
.data(response.getData()) .data(response.data())
.build(); .build();
} }
} }

View File

@@ -1,23 +1,20 @@
package com.kri.contact.server.dto.progress; package com.kri.contact.server.dto.progress;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "진행 현황 조회 요청") @Schema(description = "진행 현황 조회 요청")
public class ProgressSearchRequestDto { public record ProgressSearchRequestDto(
@Schema(description = "사용자 ID") @Schema(description = "사용자 ID")
private String userId; String userId,
@Schema(description = "회사 ID") @Schema(description = "회사 ID")
private String cmpnId; String cmpnId,
@Schema(description = "시작일시") @Schema(description = "시작일시")
private String startDt; String startDt,
@Schema(description = "종료일시") @Schema(description = "종료일시")
private String endDt; String endDt
) {
} }

View File

@@ -3,35 +3,28 @@ package com.kri.contact.server.dto.project;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "프로젝트 생성 요청") @Schema(description = "프로젝트 생성 요청")
public class ProjectCreateRequestDto { public record ProjectCreateRequestDto(
@Size(max = 128) @Size(max = 128)
@NotBlank @NotBlank
@Schema(description = "프로젝트 명") @Schema(description = "프로젝트 명")
private String prjctName; String prjctName,
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@Schema(description = "인트라넷 프로젝트 코드") @Schema(description = "인트라넷 프로젝트 코드")
private String itrntPrjctCd; String itrntPrjctCd,
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@Schema(description = "담당 그룹") @Schema(description = "담당 그룹")
private String ownerDept; String ownerDept,
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@Schema(description = "담당 실사") @Schema(description = "담당 실사")
private String ownerFw; String ownerFw
) {
} }

View File

@@ -3,27 +3,19 @@ package com.kri.contact.server.dto.project;
import com.kri.contact.server.common.enums.ChannelType; import com.kri.contact.server.common.enums.ChannelType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "프로젝트 생성 요청") @Schema(description = "프로젝트 생성 요청")
public class ProjectMainTemplateUpdateRequestDto { public record ProjectMainTemplateUpdateRequestDto(
@NotNull @NotNull
@Schema(description = "프로젝트 명") @Schema(description = "프로젝트 명")
private Long prjctIdx; Long prjctIdx,
@NotNull @NotNull
@Schema(description = "템플릿 채널 타입") @Schema(description = "템플릿 채널 타입")
private ChannelType chnnlTy; ChannelType chnnlTy,
@Schema(description = "템플릿 ID") @Schema(description = "템플릿 ID")
private Long tmplatIdx; Long tmplatIdx
) {
} }

View File

@@ -2,20 +2,14 @@ package com.kri.contact.server.dto.project;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List; import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "프로젝트 담당들 정보") @Schema(description = "프로젝트 담당들 정보")
public class ProjectOwnerResponseDto { public record ProjectOwnerResponseDto(
@Schema(description = "담당 연구 부서") @Schema(description = "담당 연구 부서")
List<String> ownerDeptList; List<String> ownerDeptList,
@Schema(description = "담당 실사 인원") @Schema(description = "담당 실사 인원")
List<String> ownerFwList; List<String> ownerFwList
) {
} }

View File

@@ -3,26 +3,23 @@ package com.kri.contact.server.dto.project;
import com.kri.common.feature.web.page.PageRequestDto; import com.kri.common.feature.web.page.PageRequestDto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "프로젝트 검색 조건") @Schema(description = "프로젝트 검색 조건")
public class ProjectSearchRequestDto { public record ProjectSearchRequestDto(
@Schema(description = "검색 텍스트") @Schema(description = "검색 텍스트")
private String prjctText; // like 대상 String prjctText, // like 대상
@Schema(description = "프로젝트 상태 리스트") @Schema(description = "프로젝트 상태 리스트")
private List<Short> prjctStatusList; // in (0,1,10) List<Short> prjctStatusList, // in (0,1,10)
@Schema(description = "담당 부서 리스트") @Schema(description = "담당 부서 리스트")
private List<String> ownerDeptList; // in ('S101','P101') List<String> ownerDeptList, // in ('S101','P101')
@Schema(description = "담당 실사 리스트") @Schema(description = "담당 실사 리스트")
private List<String> ownerFwList; // in ('jspark','jhchae') List<String> ownerFwList, // in ('jspark','jhchae')
@Schema(description = "페이지네이션 정보") @Schema(description = "페이지네이션 정보")
private PageRequestDto pageRequest; PageRequestDto pageRequest
) {
} }

View File

@@ -3,21 +3,18 @@ package com.kri.contact.server.dto.project;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "프로젝트 수정 요청") @Schema(description = "프로젝트 수정 요청")
public class ProjectUpdateRequestDto { public record ProjectUpdateRequestDto(
@NotNull @NotNull
@Schema(description = "프로젝트 정보") @Schema(description = "프로젝트 정보")
private ProjectInfoDto projectInfo; ProjectInfoDto projectInfo,
@Schema(description = "프로젝트 수정 대상 결과 코드") @Schema(description = "프로젝트 수정 대상 결과 코드")
private List<ResultCodeDto> resultCodeList; List<ResultCodeDto> resultCodeList,
@Schema(description = "프로젝트 배정 회사 목록") @Schema(description = "프로젝트 배정 회사 목록")
private List<String> assignCmpnIdList; List<String> assignCmpnIdList
) {
} }

View File

@@ -5,32 +5,29 @@ import com.kri.contact.server.common.enums.ResultCodeType;
import com.kri.contact.server.persistence.entity.TResultCodeEntity; import com.kri.contact.server.persistence.entity.TResultCodeEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@Schema(description = "결과 코드") @Schema(description = "결과 코드")
public class ResultCodeDto { public record ResultCodeDto(
@Schema(description = "결과 코드 고유 키") @Schema(description = "결과 코드 고유 키")
private String resultCdUUID; String resultCdUUID,
@Schema(description = "프로젝트 인덱스") @Schema(description = "프로젝트 인덱스")
private Long prjctIdx; Long prjctIdx,
@Schema(description = "결과 코드 타입") @Schema(description = "결과 코드 타입")
private ResultCodeType resultCdTy; ResultCodeType resultCdTy,
@Schema(description = "결과 코드") @Schema(description = "결과 코드")
private Short resultCd; Short resultCd,
@Schema(description = "결과 코드 라벨") @Schema(description = "결과 코드 라벨")
private String resultCdLbl; String resultCdLbl,
@Schema(description = "isDefault") @Schema(description = "isDefault")
private Boolean isDefault; Boolean isDefault
) {
public static ResultCodeDto from(TResultCodeEntity entity) { public static ResultCodeDto from(TResultCodeEntity entity) {
return ResultCodeDto.builder() return ResultCodeDto.builder()

View File

@@ -5,33 +5,41 @@ import io.swagger.v3.oas.annotations.media.Schema;
import com.kri.contact.server.persistence.entity.TListResveEntity; import com.kri.contact.server.persistence.entity.TListResveEntity;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "ListReserveDto") @Schema(description = "ListReserveDto")
public class ListReserveDto { public record ListReserveDto(
@Schema(description = "listResveIdx") @Schema(description = "listResveIdx")
private Long listResveIdx; Long listResveIdx,
@Schema(description = "prjctIdx") @Schema(description = "prjctIdx")
private Long prjctIdx; Long prjctIdx,
@Schema(description = "프로젝트명") @Schema(description = "프로젝트명")
private String prjctName; String prjctName,
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "memo") @Schema(description = "memo")
private String memo; String memo,
@Schema(description = "cnfirm") @Schema(description = "cnfirm")
private Boolean cnfirm; Boolean cnfirm,
@Schema(description = "resveDt") @Schema(description = "resveDt")
private LocalDateTime resveDt; LocalDateTime resveDt,
@Schema(description = "resveUser") @Schema(description = "resveUser")
private String resveUser; String resveUser,
@Schema(description = "regUser") @Schema(description = "regUser")
private String regUser; String regUser,
@Schema(description = "regDt") @Schema(description = "regDt")
private LocalDateTime regDt; LocalDateTime regDt
) {
public static ListReserveDto from(TListResveEntity entity) { public static ListReserveDto from(TListResveEntity entity) {
return from(entity, null); return from(entity, null);

View File

@@ -5,29 +5,24 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "ListReserveRequestDto") @Schema(description = "ListReserveRequestDto")
public class ListReserveRequestDto { public record ListReserveRequestDto(
@NotNull @NotNull
@Schema(description = "prjctIdx") @Schema(description = "prjctIdx")
private Long prjctIdx; Long prjctIdx,
@NotNull @NotNull
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@NotBlank @NotBlank
@Schema(description = "userId") @Schema(description = "userId")
private String userId; String userId,
@NotNull @NotNull
@Schema(description = "resveDt") @Schema(description = "resveDt")
private LocalDateTime resveDt; LocalDateTime resveDt
) {
} }

View File

@@ -2,23 +2,19 @@ package com.kri.contact.server.dto.systemlog;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "UploadContentDto") @Schema(description = "UploadContentDto")
public class UploadContentDto { public record UploadContentDto(
String fileName;
String fileType; String fileName,
Long fileSize;
String fileType,
Long fileSize
) {
public static UploadContentDto from(MultipartFile file){ public static UploadContentDto from(MultipartFile file){
return UploadContentDto.builder() return UploadContentDto.builder()
@@ -28,4 +24,3 @@ public class UploadContentDto {
.build(); .build();
} }
} }

View File

@@ -5,40 +5,36 @@ import com.kri.contact.server.persistence.entity.TRoleEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@Schema(description = "권한 정보") @Schema(description = "권한 정보")
public class RoleInfoDto { public record RoleInfoDto(
@Schema(description = "권한 코드") @Schema(description = "권한 코드")
private Integer roleCd; Integer roleCd,
@Schema(description = "권한 명") @Schema(description = "권한 명")
private String roleNm; String roleNm,
@Schema(description = "메모") @Schema(description = "메모")
private String memo; String memo,
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String regUser; String regUser,
@Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime regDt; LocalDateTime regDt,
@Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String modUser; String modUser,
@Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime modDt; LocalDateTime modDt
) {
public static RoleInfoDto from(TRoleEntity roleEntity) { public static RoleInfoDto from(TRoleEntity roleEntity) {
return RoleInfoDto.builder() return RoleInfoDto.builder()

View File

@@ -71,21 +71,21 @@ public class TCmpnEntity {
public static TCmpnEntity fromDto(CmpnInfoDto dto, String regUser, LocalDateTime regDt) { public static TCmpnEntity fromDto(CmpnInfoDto dto, String regUser, LocalDateTime regDt) {
return TCmpnEntity.builder() return TCmpnEntity.builder()
.cmpnId(dto.getCmpnId()) .cmpnId(dto.cmpnId())
.cmpnAlias(dto.getCmpnAlias()) .cmpnAlias(dto.cmpnAlias())
.cmpnTel(dto.getCmpnTel()) .cmpnTel(dto.cmpnTel())
.ownCmpn(Boolean.TRUE.equals(dto.getOwnCmpn())) .ownCmpn(Boolean.TRUE.equals(dto.ownCmpn()))
.memo(dto.getMemo()) .memo(dto.memo())
.regUser(regUser) .regUser(regUser)
.regDt(regDt) .regDt(regDt)
.build(); .build();
} }
public void updateFromDto(CmpnInfoDto dto, String modUser, LocalDateTime modDt) { public void updateFromDto(CmpnInfoDto dto, String modUser, LocalDateTime modDt) {
this.cmpnAlias = dto.getCmpnAlias(); this.cmpnAlias = dto.cmpnAlias();
this.cmpnTel = dto.getCmpnTel(); this.cmpnTel = dto.cmpnTel();
this.ownCmpn = Boolean.TRUE.equals(dto.getOwnCmpn()); this.ownCmpn = Boolean.TRUE.equals(dto.ownCmpn());
this.memo = dto.getMemo(); this.memo = dto.memo();
this.modUser = modUser; this.modUser = modUser;
this.modDt = modDt; this.modDt = modDt;
} }

View File

@@ -85,11 +85,11 @@ public class TListEventHistEntity {
return TListEventHistEntity.builder() return TListEventHistEntity.builder()
.eventTy(ResultCodeType.SURVEY.getCode()) .eventTy(ResultCodeType.SURVEY.getCode())
.prjctIdx(prjctIdx) .prjctIdx(prjctIdx)
.prjctSurveyIdx(request.getPrjctSurveyIdx()) .prjctSurveyIdx(request.prjctSurveyIdx())
.sid(request.getSid()) .sid(request.sid())
.resultCd(request.getAction().getCode().intValue()) .resultCd(request.action().getCode().intValue())
.metaData(metaData) .metaData(metaData)
.memo(request.getAction().name()) .memo(request.action().name())
.regUser(regUser) .regUser(regUser)
.regDt(regDt) .regDt(regDt)
.build(); .build();
@@ -102,13 +102,13 @@ public class TListEventHistEntity {
LocalDateTime regDt LocalDateTime regDt
) { ) {
return TListEventHistEntity.builder() return TListEventHistEntity.builder()
.eventTy(request.getResultCodeType().getCode()) .eventTy(request.resultCodeType().getCode())
.prjctIdx(request.getPrjctIdx()) .prjctIdx(request.prjctIdx())
.sid(request.getSid()) .sid(request.sid())
.resultCd(request.getResultCd()) .resultCd(request.resultCd())
.listCallHistIdx(request.getListCallHistIdx()) .listCallHistIdx(request.listCallHistIdx())
.metaData(metaData) .metaData(metaData)
.memo(request.getMemo()) .memo(request.memo())
.regUser(regUser) .regUser(regUser)
.regDt(regDt) .regDt(regDt)
.build(); .build();

View File

@@ -120,10 +120,10 @@ public class TPrjctEntity {
return TPrjctEntity.builder() return TPrjctEntity.builder()
.prjctCd(prjctCd) .prjctCd(prjctCd)
.prjctStatus(ProjectStatus.STANDBY.getCode()) .prjctStatus(ProjectStatus.STANDBY.getCode())
.prjctNm(req.getPrjctName()) .prjctNm(req.prjctName())
.itrntPrjctCd(req.getItrntPrjctCd()) .itrntPrjctCd(req.itrntPrjctCd())
.ownerDept(req.getOwnerDept()) .ownerDept(req.ownerDept())
.ownerFw(req.getOwnerFw()) .ownerFw(req.ownerFw())
.callerTelNum(DEFAULT_CALLER_TELNUM) .callerTelNum(DEFAULT_CALLER_TELNUM)
.ff(false) .ff(false)
.useContactSenario(false) .useContactSenario(false)

View File

@@ -46,8 +46,8 @@ public class TPrjctMainTmplatEntity {
public static TPrjctMainTmplatEntity create(ProjectMainTemplateUpdateRequestDto req, public static TPrjctMainTmplatEntity create(ProjectMainTemplateUpdateRequestDto req,
String regUser, LocalDateTime regDt) { String regUser, LocalDateTime regDt) {
return TPrjctMainTmplatEntity.builder() return TPrjctMainTmplatEntity.builder()
.id(TPrjctMainTmplatEntityId.create(req.getPrjctIdx(), req.getChnnlTy().getCode())) .id(TPrjctMainTmplatEntityId.create(req.prjctIdx(), req.chnnlTy().getCode()))
.tmplatIdx(req.getTmplatIdx()) .tmplatIdx(req.tmplatIdx())
.regUser(regUser) .regUser(regUser)
.regDt(regDt) .regDt(regDt)
.build(); .build();

View File

@@ -69,8 +69,8 @@ public class TResultCodeEntity {
public static TResultCodeEntity fromDto(Long prjctIdx, ResultCodeType resultCdTy, public static TResultCodeEntity fromDto(Long prjctIdx, ResultCodeType resultCdTy,
ResultCodeDto req, String regUser, LocalDateTime regDt) { ResultCodeDto req, String regUser, LocalDateTime regDt) {
return TResultCodeEntity.builder() return TResultCodeEntity.builder()
.id(TResultCodeEntityId.create(prjctIdx, resultCdTy, req.getResultCd())) .id(TResultCodeEntityId.create(prjctIdx, resultCdTy, req.resultCd()))
.resultCdLbl(req.getResultCdLbl()) .resultCdLbl(req.resultCdLbl())
.defaultCode(false) .defaultCode(false)
.regUser(regUser) .regUser(regUser)
.regDt(regDt) .regDt(regDt)

View File

@@ -601,12 +601,12 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
for (int index = 0; index < conditions.size(); index++) { for (int index = 0; index < conditions.size(); index++) {
LastEventDateRangeDto condition = conditions.get(index); LastEventDateRangeDto condition = conditions.get(index);
if (condition == null || condition.getResultCodeType() == null) { if (condition == null || condition.resultCodeType() == null) {
continue; continue;
} }
LocalDateTime startDate = condition.getStartDate(); LocalDateTime startDate = condition.startDate();
LocalDateTime endDate = condition.getEndDate(); LocalDateTime endDate = condition.endDate();
if (startDate == null && endDate == null) { if (startDate == null && endDate == null) {
continue; continue;
} }
@@ -616,7 +616,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
endDate = swapped; endDate = swapped;
} }
ResultCodeType resultCodeType = condition.getResultCodeType(); ResultCodeType resultCodeType = condition.resultCodeType();
QTListEventLatestEntity latest = new QTListEventLatestEntity("latest_event_date_" + index); QTListEventLatestEntity latest = new QTListEventLatestEntity("latest_event_date_" + index);
BooleanBuilder latestPredicate = new BooleanBuilder() BooleanBuilder latestPredicate = new BooleanBuilder()
.and(latest.prjctIdx.eq(prjctIdx)) .and(latest.prjctIdx.eq(prjctIdx))
@@ -624,7 +624,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
.and(latest.eventTy.eq(resultCodeType.getCode())); .and(latest.eventTy.eq(resultCodeType.getCode()));
if (resultCodeType == ResultCodeType.SURVEY) { if (resultCodeType == ResultCodeType.SURVEY) {
latestPredicate.and(latest.prjctSurveyIdx.eq(condition.getPrjctSurveyIdx())); latestPredicate.and(latest.prjctSurveyIdx.eq(condition.prjctSurveyIdx()));
} else { } else {
latestPredicate.and(latest.prjctSurveyIdx.isNull()); latestPredicate.and(latest.prjctSurveyIdx.isNull());
} }
@@ -654,16 +654,16 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
for (ListSurveyResultFilterConditionDto condition : surveyResultConditions) { for (ListSurveyResultFilterConditionDto condition : surveyResultConditions) {
if (condition == null if (condition == null
|| condition.getPrjctSurveyIdx() == null || condition.prjctSurveyIdx() == null
|| condition.getResultCodes() == null || condition.resultCodes() == null
|| condition.getResultCodes().isEmpty()) { || condition.resultCodes().isEmpty()) {
continue; continue;
} }
boolean includeNoHistory = condition.getResultCodes().stream() boolean includeNoHistory = condition.resultCodes().stream()
.filter(Objects::nonNull) .filter(Objects::nonNull)
.anyMatch(resultCode -> resultCode == NO_RESULT_HISTORY_CODE); .anyMatch(resultCode -> resultCode == NO_RESULT_HISTORY_CODE);
List<Integer> existingHistoryResultCodes = condition.getResultCodes().stream() List<Integer> existingHistoryResultCodes = condition.resultCodes().stream()
.filter(Objects::nonNull) .filter(Objects::nonNull)
.filter(resultCode -> resultCode != NO_RESULT_HISTORY_CODE) .filter(resultCode -> resultCode != NO_RESULT_HISTORY_CODE)
.distinct() .distinct()
@@ -674,7 +674,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
BooleanBuilder surveyPredicate = new BooleanBuilder(); BooleanBuilder surveyPredicate = new BooleanBuilder();
QTListEventLatestEntity latest = new QTListEventLatestEntity( QTListEventLatestEntity latest = new QTListEventLatestEntity(
"latest_survey_result_" + condition.getPrjctSurveyIdx() "latest_survey_result_" + condition.prjctSurveyIdx()
); );
if (!existingHistoryResultCodes.isEmpty()) { if (!existingHistoryResultCodes.isEmpty()) {
@@ -684,7 +684,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
latest.prjctIdx.eq(prjctIdx), latest.prjctIdx.eq(prjctIdx),
latest.sid.eq(list.id.sid), latest.sid.eq(list.id.sid),
latest.eventTy.eq(ResultCodeType.SURVEY.getCode()), latest.eventTy.eq(ResultCodeType.SURVEY.getCode()),
latest.prjctSurveyIdx.eq(condition.getPrjctSurveyIdx()), latest.prjctSurveyIdx.eq(condition.prjctSurveyIdx()),
latest.resultCd.in(existingHistoryResultCodes) latest.resultCd.in(existingHistoryResultCodes)
) )
.exists()); .exists());
@@ -692,7 +692,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
if (includeNoHistory) { if (includeNoHistory) {
QTListEventLatestEntity noHistoryLatest = new QTListEventLatestEntity( QTListEventLatestEntity noHistoryLatest = new QTListEventLatestEntity(
"no_history_survey_result_" + condition.getPrjctSurveyIdx() "no_history_survey_result_" + condition.prjctSurveyIdx()
); );
surveyPredicate.or(JPAExpressions.selectOne() surveyPredicate.or(JPAExpressions.selectOne()
.from(noHistoryLatest) .from(noHistoryLatest)
@@ -700,7 +700,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
noHistoryLatest.prjctIdx.eq(prjctIdx), noHistoryLatest.prjctIdx.eq(prjctIdx),
noHistoryLatest.sid.eq(list.id.sid), noHistoryLatest.sid.eq(list.id.sid),
noHistoryLatest.eventTy.eq(ResultCodeType.SURVEY.getCode()), noHistoryLatest.eventTy.eq(ResultCodeType.SURVEY.getCode()),
noHistoryLatest.prjctSurveyIdx.eq(condition.getPrjctSurveyIdx()) noHistoryLatest.prjctSurveyIdx.eq(condition.prjctSurveyIdx())
) )
.notExists()); .notExists());
} }

View File

@@ -81,7 +81,7 @@ public class AssignService {
.toList(); .toList();
long assignedCount = assignees.stream() long assignedCount = assignees.stream()
.mapToLong(CompanyAssignSummaryItemDto::getAssignedCount) .mapToLong(CompanyAssignSummaryItemDto::assignedCount)
.sum(); .sum();
validateSummaryCount(totalCount, assignedCount); validateSummaryCount(totalCount, assignedCount);

View File

@@ -28,14 +28,14 @@ public class AuthService {
JwtUserClaimsDto claims; JwtUserClaimsDto claims;
if (loginInfoResponse != null) { if (loginInfoResponse != null) {
claims = JwtUserClaimsDto.builder() claims = JwtUserClaimsDto.builder()
.userId(loginInfoResponse.getUserId()) .userId(loginInfoResponse.userId())
.userCmpn(DEFAULT_COMPANY_NAME) .userCmpn(DEFAULT_COMPANY_NAME)
.userName(loginInfoResponse.getUserNm()) .userName(loginInfoResponse.userNm())
.userTeam(loginInfoResponse.getUserTeam()) .userTeam(loginInfoResponse.userTeam())
.userRole(loginInfoResponse.getUserRole()) .userRole(loginInfoResponse.userRole())
.build(); .build();
} else { } else {
TUserEntity user = userService.getUser(request.getUserId(), request.getUserPw()); TUserEntity user = userService.getUser(request.userId(), request.userPw());
claims = JwtUserClaimsDto.builder() claims = JwtUserClaimsDto.builder()
.userId(user.getUserId()) .userId(user.getUserId())
.userCmpn(user.getUserCmpn()) .userCmpn(user.getUserCmpn())

View File

@@ -33,9 +33,9 @@ public class CmpnService {
@Transactional @Transactional
public void createCmpn(CmpnInfoDto dto, String regUser, LocalDateTime regDt) { public void createCmpn(CmpnInfoDto dto, String regUser, LocalDateTime regDt) {
DataVerificationDto verification = verifyCmpnId(dto.getCmpnId()); DataVerificationDto verification = verifyCmpnId(dto.cmpnId());
if (!verification.isSuccess()) { if (!verification.success()) {
throw BusinessException.badRequest("WRONG_CMPN_DATA", verification.getErrMessage()); throw BusinessException.badRequest("WRONG_CMPN_DATA", verification.errMessage());
} }
validateCmpnDto(dto); validateCmpnDto(dto);
@@ -45,7 +45,7 @@ public class CmpnService {
@Transactional @Transactional
public void updateCmpn(CmpnInfoDto dto, String modUser, LocalDateTime modDt) { public void updateCmpn(CmpnInfoDto dto, String modUser, LocalDateTime modDt) {
validateCmpnDto(dto); validateCmpnDto(dto);
TCmpnEntity entity = findCmpn(dto.getCmpnId()); TCmpnEntity entity = findCmpn(dto.cmpnId());
entity.updateFromDto(dto, modUser, modDt); entity.updateFromDto(dto, modUser, modDt);
} }
@@ -74,7 +74,7 @@ public class CmpnService {
} }
private void validateCmpnDto(CmpnInfoDto dto) { private void validateCmpnDto(CmpnInfoDto dto) {
if (dto.getCmpnAlias() == null || dto.getCmpnAlias().isBlank()) { if (dto.cmpnAlias() == null || dto.cmpnAlias().isBlank()) {
throw BusinessException.badRequest("WRONG_CMPN_DATA", "회사 별칭이 비어 있습니다."); throw BusinessException.badRequest("WRONG_CMPN_DATA", "회사 별칭이 비어 있습니다.");
} }
} }

View File

@@ -940,9 +940,9 @@ public class ListDownloadService {
return; return;
} }
if (dateRange.getStartDate() != null if (dateRange.startDate() != null
&& dateRange.getEndDate() != null && dateRange.endDate() != null
&& dateRange.getStartDate().isAfter(dateRange.getEndDate())) { && dateRange.startDate().isAfter(dateRange.endDate())) {
throw BusinessException.badRequest("INVALID_DATE_RANGE", "시작일은 종료일보다 늦을 수 없습니다."); throw BusinessException.badRequest("INVALID_DATE_RANGE", "시작일은 종료일보다 늦을 수 없습니다.");
} }
} }

View File

@@ -180,7 +180,7 @@ public class ListHeaderService {
} }
int headerId = nextId++; int headerId = nextId++;
ListHeaderType type = resolveType(headerId, request.getSpecificHeader()); ListHeaderType type = resolveType(headerId, request.specificHeader());
result.add(ListHeaderDto.newCommon(prjctIdx, headerId, headerName, type)); result.add(ListHeaderDto.newCommon(prjctIdx, headerId, headerName, type));
} }

View File

@@ -131,9 +131,9 @@ public class ListSearchService {
) { ) {
List<TListEntity> listEntities = findPagedListEntities(prjctIdx, request); List<TListEntity> listEntities = findPagedListEntities(prjctIdx, request);
List<T> content = createListSearch(prjctIdx, listEntities, responseType); List<T> content = createListSearch(prjctIdx, listEntities, responseType);
int totalCount = findAllSids(prjctIdx, request == null ? null : request.getListFilter()).size(); int totalCount = findAllSids(prjctIdx, request == null ? null : request.listFilter()).size();
PageRequestDto pageRequest = request == null ? null : request.getPageRequest(); PageRequestDto pageRequest = request == null ? null : request.pageRequest();
int pageIndex = pageRequest == null ? 0 : Math.max(pageRequest.getPageIndex(), 0); int pageIndex = pageRequest == null ? 0 : Math.max(pageRequest.getPageIndex(), 0);
int pageSize = pageRequest == null ? Math.max(totalCount, 1) : Math.max(pageRequest.getPageSize(), 1); int pageSize = pageRequest == null ? Math.max(totalCount, 1) : Math.max(pageRequest.getPageSize(), 1);
@@ -410,13 +410,13 @@ public class ListSearchService {
private List<TListEntity> findPagedListEntities(Long prjctIdx, ListSearchRequestDto request) { private List<TListEntity> findPagedListEntities(Long prjctIdx, ListSearchRequestDto request) {
List<Integer> exactMatchHeaderIds = listHeaderService.getExactMatchHeaderId(prjctIdx); List<Integer> exactMatchHeaderIds = listHeaderService.getExactMatchHeaderId(prjctIdx);
ListFilterDto listFilter = request == null ? null : request.getListFilter(); ListFilterDto listFilter = request == null ? null : request.listFilter();
return listRepository.findPagedListEntities( return listRepository.findPagedListEntities(
prjctIdx, prjctIdx,
exactMatchHeaderIds, exactMatchHeaderIds,
listFilter, listFilter,
request == null ? null : request.getPageRequest() request == null ? null : request.pageRequest()
); );
} }
@@ -693,11 +693,11 @@ public class ListSearchService {
} }
private LocalDateTime getStartDate(DateRangeDto dateRange) { private LocalDateTime getStartDate(DateRangeDto dateRange) {
return dateRange == null ? null : dateRange.getStartDate(); return dateRange == null ? null : dateRange.startDate();
} }
private LocalDateTime getEndDate(DateRangeDto dateRange) { private LocalDateTime getEndDate(DateRangeDto dateRange) {
return dateRange == null ? null : dateRange.getEndDate(); return dateRange == null ? null : dateRange.endDate();
} }
private String resolveHeaderName(Map<Integer, ListHeaderDto> headerMap, Integer headerId) { private String resolveHeaderName(Map<Integer, ListHeaderDto> headerMap, Integer headerId) {

View File

@@ -213,14 +213,14 @@ public class ListUpdateService {
lockSurveyHistoryUntilTransactionCompletion(request); lockSurveyHistoryUntilTransactionCompletion(request);
TPrjctSurveyEntity survey = validateProjectSurvey(request); TPrjctSurveyEntity survey = validateProjectSurvey(request);
validateEventHistoryTarget(survey.getPrjctIdx(), request.getSid()); validateEventHistoryTarget(survey.getPrjctIdx(), request.sid());
applySurveySnapshot(request, survey); applySurveySnapshot(request, survey);
if (request.getAction() == ListEventHistorySurveyType.START if (request.action() == ListEventHistorySurveyType.START
&& listEventLatestRepository.existsByPrjctIdxAndPrjctSurveyIdxAndSidAndEventTyAndResultCdNot( && listEventLatestRepository.existsByPrjctIdxAndPrjctSurveyIdxAndSidAndEventTyAndResultCdNot(
survey.getPrjctIdx(), survey.getPrjctIdx(),
request.getPrjctSurveyIdx(), request.prjctSurveyIdx(),
request.getSid(), request.sid(),
ResultCodeType.SURVEY.getCode(), ResultCodeType.SURVEY.getCode(),
ListEventHistorySurveyType.START.getCode().intValue() ListEventHistorySurveyType.START.getCode().intValue()
)) { )) {
@@ -241,7 +241,7 @@ public class ListUpdateService {
throw BusinessException.internalError("SURVEY_HISTORY_TRANSACTION_REQUIRED", "설문 이력 처리는 활성 트랜잭션 동기화가 필요합니다."); throw BusinessException.internalError("SURVEY_HISTORY_TRANSACTION_REQUIRED", "설문 이력 처리는 활성 트랜잭션 동기화가 필요합니다.");
} }
SurveyHistoryKey key = new SurveyHistoryKey(request.getPrjctSurveyIdx(), request.getSid()); SurveyHistoryKey key = new SurveyHistoryKey(request.prjctSurveyIdx(), request.sid());
// acquire 전에 참조를 등록해야 마지막 보유자가 잠금 객체를 제거하는 경쟁을 막을 수 있다. // acquire 전에 참조를 등록해야 마지막 보유자가 잠금 객체를 제거하는 경쟁을 막을 수 있다.
SurveyHistoryLock lock = surveyHistoryLocks.compute(key, (ignored, current) -> { SurveyHistoryLock lock = surveyHistoryLocks.compute(key, (ignored, current) -> {
SurveyHistoryLock selected = current == null ? new SurveyHistoryLock() : current; SurveyHistoryLock selected = current == null ? new SurveyHistoryLock() : current;
@@ -351,10 +351,10 @@ public class ListUpdateService {
} }
Set<Long> surveyIds = new LinkedHashSet<>(); Set<Long> surveyIds = new LinkedHashSet<>();
for (ListSurveyResultUpdateDto update : surveyResultCodes) { for (ListSurveyResultUpdateDto update : surveyResultCodes) {
if (update == null || update.getPrjctSurveyIdx() == null || update.getResultCd() == null) { if (update == null || update.prjctSurveyIdx() == null || update.resultCd() == null) {
throw BusinessException.badRequest("INVALID_SURVEY_RESULT_UPDATE", "설문 결과 수정 내용이 올바르지 않습니다."); throw BusinessException.badRequest("INVALID_SURVEY_RESULT_UPDATE", "설문 결과 수정 내용이 올바르지 않습니다.");
} }
Long surveyId = update.getPrjctSurveyIdx(); Long surveyId = update.prjctSurveyIdx();
if (!surveyIds.add(surveyId)) { if (!surveyIds.add(surveyId)) {
throw BusinessException.badRequest("DUPLICATE_SURVEY_RESULT_UPDATE", "같은 설문의 결과가 중복 지정되었습니다."); throw BusinessException.badRequest("DUPLICATE_SURVEY_RESULT_UPDATE", "같은 설문의 결과가 중복 지정되었습니다.");
} }
@@ -363,7 +363,7 @@ public class ListUpdateService {
.orElseThrow(() -> BusinessException.badRequest( .orElseThrow(() -> BusinessException.badRequest(
"PROJECT_SURVEY_NOT_FOUND", "프로젝트 설문을 찾을 수 없습니다." "PROJECT_SURVEY_NOT_FOUND", "프로젝트 설문을 찾을 수 없습니다."
).with("prjctSurveyIdx", surveyId)); ).with("prjctSurveyIdx", surveyId));
Integer resultCd = update.getResultCd(); Integer resultCd = update.resultCd();
if (resultCd < Short.MIN_VALUE || resultCd > Short.MAX_VALUE) { if (resultCd < Short.MIN_VALUE || resultCd > Short.MAX_VALUE) {
throw BusinessException.badRequest("RESULT_CODE_NOT_FOUND", "존재하지 않는 결과 코드입니다."); throw BusinessException.badRequest("RESULT_CODE_NOT_FOUND", "존재하지 않는 결과 코드입니다.");
} }
@@ -411,9 +411,9 @@ public class ListUpdateService {
rows.add(new ListEventHistInsertRow( rows.add(new ListEventHistInsertRow(
ResultCodeType.SURVEY.getCode(), ResultCodeType.SURVEY.getCode(),
prjctIdx, prjctIdx,
update.getPrjctSurveyIdx(), update.prjctSurveyIdx(),
sid, sid,
update.getResultCd(), update.resultCd(),
null, null,
"", "",
regUser, regUser,
@@ -431,20 +431,20 @@ public class ListUpdateService {
} }
private TPrjctSurveyEntity validateProjectSurvey(ListEventHistFromSurveyDto request) { private TPrjctSurveyEntity validateProjectSurvey(ListEventHistFromSurveyDto request) {
TPrjctSurveyEntity survey = projectSurveyRepository.findById(request.getPrjctSurveyIdx()) TPrjctSurveyEntity survey = projectSurveyRepository.findById(request.prjctSurveyIdx())
.orElseThrow(() -> BusinessException.badRequest( .orElseThrow(() -> BusinessException.badRequest(
"PROJECT_SURVEY_NOT_FOUND", "PROJECT_SURVEY_NOT_FOUND",
"프로젝트 설문을 찾을 수 없습니다." "프로젝트 설문을 찾을 수 없습니다."
).with("prjctSurveyIdx", request.getPrjctSurveyIdx())); ).with("prjctSurveyIdx", request.prjctSurveyIdx()));
return survey; return survey;
} }
private void applySurveySnapshot(ListEventHistFromSurveyDto request, TPrjctSurveyEntity survey) { private void applySurveySnapshot(ListEventHistFromSurveyDto request, TPrjctSurveyEntity survey) {
ListEventHistSurveyMetaDto meta = request.getMeta(); ListEventHistSurveyMetaDto meta = request.meta();
if (meta.getAction() != null && !Objects.equals(meta.getAction(), request.getAction())) { if (meta.getAction() != null && !Objects.equals(meta.getAction(), request.action())) {
throw BusinessException.badRequest("INVALID_SURVEY_ACTION", "설문 action이 일치하지 않습니다."); throw BusinessException.badRequest("INVALID_SURVEY_ACTION", "설문 action이 일치하지 않습니다.");
} }
meta.setAction(request.getAction()); meta.setAction(request.action());
meta.setSurvey(SurveySnapshot.builder() meta.setSurvey(SurveySnapshot.builder()
.prjctSurveyIdx(survey.getPrjctSurveyIdx()) .prjctSurveyIdx(survey.getPrjctSurveyIdx())
.surveyName(survey.getSurveyNm()) .surveyName(survey.getSurveyNm())
@@ -461,18 +461,18 @@ public class ListUpdateService {
Integer userRole, Integer userRole,
LocalDateTime regDt LocalDateTime regDt
) { ) {
validateEventHistoryTarget(request.getPrjctIdx(), request.getSid()); validateEventHistoryTarget(request.prjctIdx(), request.sid());
validateResultCode(request); validateResultCode(request);
listCallHistService.validateListCallHistoryForEvent( listCallHistService.validateListCallHistoryForEvent(
request.getListCallHistIdx(), request.listCallHistIdx(),
request.getPrjctIdx(), request.prjctIdx(),
request.getSid(), request.sid(),
regUser, regUser,
userCmpn, userCmpn,
userRole userRole
); );
ListEventHistInternalMetaDto meta = ListEventHistInternalMetaDto.withRemoteAddr( ListEventHistInternalMetaDto meta = ListEventHistInternalMetaDto.withRemoteAddr(
request.getMeta(), request.meta(),
remoteAddr remoteAddr
); );
@@ -483,28 +483,28 @@ public class ListUpdateService {
regDt regDt
)); ));
if (request.getResultCodeType() == ResultCodeType.CONTACT) { if (request.resultCodeType() == ResultCodeType.CONTACT) {
reserveService.confirmByProjectSidAndUser( reserveService.confirmByProjectSidAndUser(
request.getPrjctIdx(), request.prjctIdx(),
request.getSid(), request.sid(),
regUser regUser
); );
} }
} }
private void validateResultCode(ListEventHistInsertRequestDto request) { private void validateResultCode(ListEventHistInsertRequestDto request) {
if (request.getResultCd() < Short.MIN_VALUE || request.getResultCd() > Short.MAX_VALUE) { if (request.resultCd() < Short.MIN_VALUE || request.resultCd() > Short.MAX_VALUE) {
throw BusinessException.badRequest("RESULT_CODE_NOT_FOUND", "존재하지 않는 결과 코드입니다."); throw BusinessException.badRequest("RESULT_CODE_NOT_FOUND", "존재하지 않는 결과 코드입니다.");
} }
resultCodeService.validateResultCodeExists( resultCodeService.validateResultCodeExists(
request.getPrjctIdx(), request.prjctIdx(),
request.getResultCodeType(), request.resultCodeType(),
request.getResultCd().shortValue() request.resultCd().shortValue()
); );
} }
private String writeMetaData(ListEventHistFromSurveyDto request) { private String writeMetaData(ListEventHistFromSurveyDto request) {
return writeMetaData(request.getMeta()); return writeMetaData(request.meta());
} }
private String writeMetaData(Object meta) { private String writeMetaData(Object meta) {

View File

@@ -362,7 +362,7 @@ public class ListUploadService {
prjctIdx, prjctIdx,
listUploadLogRepository.findMaxWaveByPrjctIdx(prjctIdx) + 1, listUploadLogRepository.findMaxWaveByPrjctIdx(prjctIdx) + 1,
listFilePath.getFileName().toString(), listFilePath.getFileName().toString(),
request.getUploadMode().getCode(), request.uploadMode().getCode(),
objectMapper.convertValue(request, new TypeReference<Map<String, Object>>() {}), objectMapper.convertValue(request, new TypeReference<Map<String, Object>>() {}),
uploadUser, uploadUser,
uploadDt uploadDt
@@ -433,7 +433,7 @@ public class ListUploadService {
String uploadUser, String uploadUser,
LocalDateTime uploadDt LocalDateTime uploadDt
) { ) {
if (request.getUploadMode() == ListUploadMode.RESET_AND_INSERT) { if (request.uploadMode() == ListUploadMode.RESET_AND_INSERT) {
listResetService.resetByFilter( listResetService.resetByFilter(
prjctIdx, prjctIdx,
null, null,
@@ -442,7 +442,7 @@ public class ListUploadService {
uploadDt uploadDt
); );
} }
else if (request.getUploadMode() == ListUploadMode.ADD_AND_CHANGE && !uploadedSids.isEmpty()) { else if (request.uploadMode() == ListUploadMode.ADD_AND_CHANGE && !uploadedSids.isEmpty()) {
listResetService.resetBySids( listResetService.resetBySids(
prjctIdx, prjctIdx,
uploadedSids, uploadedSids,
@@ -579,7 +579,7 @@ public class ListUploadService {
@Transactional(propagation = Propagation.REQUIRES_NEW) @Transactional(propagation = Propagation.REQUIRES_NEW)
public PreparedUpload prepareAsync(Long projectId, Path source, ListUploadRequestDto request, public PreparedUpload prepareAsync(Long projectId, Path source, ListUploadRequestDto request,
String logId, Runnable checkCancelled) { String logId, Runnable checkCancelled) {
if (request.getUploadMode() == null) { if (request.uploadMode() == null) {
throw BusinessException.badRequest("ASYNC_UPLOAD_MODE_REQUIRED", "Upload mode is required"); throw BusinessException.badRequest("ASYNC_UPLOAD_MODE_REQUIRED", "Upload mode is required");
} }
try { try {
@@ -602,7 +602,7 @@ public class ListUploadService {
var validation = validateFile(projectId, source, request, headers, assignedUsers, assignedCompanies, var validation = validateFile(projectId, source, request, headers, assignedUsers, assignedCompanies,
assignService.findActiveUserRoleMap(assignedUsers), roles, assignService.findActiveUserRoleMap(assignedUsers), roles,
assignService.findAllowedUserRolesByAssignRole(new LinkedHashSet<>(roles.values())), assignService.findAllowedUserRolesByAssignRole(new LinkedHashSet<>(roles.values())),
companies, logId, checkCancelled, request.getUploadMode() != ListUploadMode.RESET_AND_INSERT); companies, logId, checkCancelled, request.uploadMode() != ListUploadMode.RESET_AND_INSERT);
checkCancelled.run(); checkCancelled.run();
var log = listUploadLogRepository.findById(logId).orElseThrow(() -> var log = listUploadLogRepository.findById(logId).orElseThrow(() ->
BusinessException.internalError("LIST_UPLOAD_LOG_NOT_FOUND", "업로드 로그를 찾을 수 없습니다.")); BusinessException.internalError("LIST_UPLOAD_LOG_NOT_FOUND", "업로드 로그를 찾을 수 없습니다."));
@@ -820,7 +820,7 @@ public class ListUploadService {
continue; continue;
} }
if (request.isCheckDuplicateEmail()) { if (request.checkDuplicateEmail()) {
tempBuffer.add(new TmpSpecialRow( tempBuffer.add(new TmpSpecialRow(
listUploadLogId, prjctIdx, rowNo, sid, header.getListHderId(), listUploadLogId, prjctIdx, rowNo, sid, header.getListHderId(),
ListHeaderTypeSpecific.EMAIL.getCode(), ListHeaderTypeSpecific.EMAIL.getCode(),
@@ -840,7 +840,7 @@ public class ListUploadService {
continue; continue;
} }
if (request.isCheckDuplicatePhone()) { if (request.checkDuplicatePhone()) {
tempBuffer.add(new TmpSpecialRow( tempBuffer.add(new TmpSpecialRow(
listUploadLogId, prjctIdx, rowNo, sid, header.getListHderId(), listUploadLogId, prjctIdx, rowNo, sid, header.getListHderId(),
ListHeaderTypeSpecific.TEL_NUM.getCode(), ListHeaderTypeSpecific.TEL_NUM.getCode(),
@@ -866,9 +866,9 @@ public class ListUploadService {
errors.add(ListUploadErrorDto.of(hit.rowNo(), hit.sid(), fieldName, "업로드 파일 내 중복값입니다.")); errors.add(ListUploadErrorDto.of(hit.rowNo(), hit.sid(), fieldName, "업로드 파일 내 중복값입니다."));
} }
if (checkExistingDuplicates && (request.isCheckDuplicateEmail() || request.isCheckDuplicatePhone())) { if (checkExistingDuplicates && (request.checkDuplicateEmail() || request.checkDuplicatePhone())) {
boolean excludeSameSid = request.getUploadMode() == ListUploadMode.RESET_AND_INSERT boolean excludeSameSid = request.uploadMode() == ListUploadMode.RESET_AND_INSERT
|| request.getUploadMode() == ListUploadMode.ADD_AND_CHANGE; || request.uploadMode() == ListUploadMode.ADD_AND_CHANGE;
for (ListUploadJdbcSupport.DuplicateHit hit : listUploadJdbcSupport.findDbDuplicateRows( for (ListUploadJdbcSupport.DuplicateHit hit : listUploadJdbcSupport.findDbDuplicateRows(
listUploadLogId, prjctIdx, excludeSameSid listUploadLogId, prjctIdx, excludeSameSid
)) { )) {

View File

@@ -50,7 +50,7 @@ public class MessageResultService {
return notiHubApiClient.getLastSendResults(channelTy, REQUEST_SERVICE, prjctCd, sidValues) return notiHubApiClient.getLastSendResults(channelTy, REQUEST_SERVICE, prjctCd, sidValues)
.stream() .stream()
.collect(Collectors.toMap( .collect(Collectors.toMap(
dto -> dto.getSid(), dto -> dto.sid(),
ListSendResultDto::from, ListSendResultDto::from,
(left, right) -> left, (left, right) -> left,
LinkedHashMap::new LinkedHashMap::new

View File

@@ -106,10 +106,10 @@ public class MessageSendService {
RequestUserContext ctx, RequestUserContext ctx,
ChannelType channelType ChannelType channelType
) { ) {
validateDestinationHeaders(request.getDestHeaderIds()); validateDestinationHeaders(request.destHeaderIds());
String sid = requireSid(request.getSid()); String sid = requireSid(request.sid());
MessageContext messageContext = createMessageContext(prjctIdx, request.getTmplatIdx(), request.getDestHeaderIds()); MessageContext messageContext = createMessageContext(prjctIdx, request.tmplatIdx(), request.destHeaderIds());
ListSearchService.DownloadListRow row = listSearchService ListSearchService.DownloadListRow row = listSearchService
.findDownloadListRows(prjctIdx, ListFilterDtoFactory.onlySid(sid), null) .findDownloadListRows(prjctIdx, ListFilterDtoFactory.onlySid(sid), null)
.stream() .stream()
@@ -119,8 +119,8 @@ public class MessageSendService {
List<NotiHubDestInfoDto> destInfos = createDestInfos( List<NotiHubDestInfoDto> destInfos = createDestInfos(
List.of(row), List.of(row),
request.getDestHeaderIds(), request.destHeaderIds(),
request.getDestNameHeaderId(), request.destNameHeaderId(),
messageContext, messageContext,
channelType, channelType,
new LinkedHashSet<>(), new LinkedHashSet<>(),
@@ -134,11 +134,11 @@ public class MessageSendService {
for (NotiHubDestInfoDto destInfo : destInfos) { for (NotiHubDestInfoDto destInfo : destInfos) {
NotiHubSendRequestSingleDto notiRequest = NotiHubSendRequestSingleDto.builder() NotiHubSendRequestSingleDto notiRequest = NotiHubSendRequestSingleDto.builder()
.destInfo(destInfo) .destInfo(destInfo)
.tmplatIdx(request.getTmplatIdx()) .tmplatIdx(request.tmplatIdx())
.reqstSvc(REQUEST_SERVICE) .reqstSvc(REQUEST_SERVICE)
.prjctCd(messageContext.project().getPrjctCd()) .prjctCd(messageContext.project().getPrjctCd())
.resve(request.getResve()) .resve(request.resve())
.sendDt(request.getSendDt()) .sendDt(request.sendDt())
.build(); .build();
if (channelType == ChannelType.EMAIL) { if (channelType == ChannelType.EMAIL) {
@@ -158,18 +158,18 @@ public class MessageSendService {
RequestUserContext ctx, RequestUserContext ctx,
ChannelType channelType ChannelType channelType
) { ) {
validateDestinationHeaders(request.getDestHeaderIds()); validateDestinationHeaders(request.destHeaderIds());
requireValidFilterConditions( requireValidFilterConditions(
request.getListFilter() == null ? null : request.getListFilter().getSidSet() request.listFilter() == null ? null : request.listFilter().getSidSet()
); );
MessageContext messageContext = createMessageContext(prjctIdx, request.getTmplatIdx(), request.getDestHeaderIds()); MessageContext messageContext = createMessageContext(prjctIdx, request.tmplatIdx(), request.destHeaderIds());
List<NotiHubDestInfoDto> destInfos = createAllDestInfos( List<NotiHubDestInfoDto> destInfos = createAllDestInfos(
prjctIdx, prjctIdx,
request, request,
messageContext, messageContext,
channelType, channelType,
Boolean.TRUE.equals(request.getDedupe()) request.dedupe()
); );
if (destInfos.isEmpty()) { if (destInfos.isEmpty()) {
throw BusinessException.badRequest("NO_DESTINATION", "발송 대상 이메일 또는 전화번호가 없습니다."); throw BusinessException.badRequest("NO_DESTINATION", "발송 대상 이메일 또는 전화번호가 없습니다.");
@@ -186,9 +186,9 @@ public class MessageSendService {
List<NotiHubDestInfoDto> chunk = destInfos.subList(start, end); List<NotiHubDestInfoDto> chunk = destInfos.subList(start, end);
try { try {
NotiHubBulkSendResponseDto response = sendBulkChunk(bulkSendKey, chunk, channelType); NotiHubBulkSendResponseDto response = sendBulkChunk(bulkSendKey, chunk, channelType);
requestCount += defaultInt(response.getRequestCount()); requestCount += defaultInt(response.requestCount());
acceptCount += defaultInt(response.getAcceptCount()); acceptCount += defaultInt(response.acceptCount());
failCount += defaultInt(response.getFailCount()); failCount += defaultInt(response.failCount());
} catch (RuntimeException e) { } catch (RuntimeException e) {
requestCount += chunk.size(); requestCount += chunk.size();
failCount += chunk.size(); failCount += chunk.size();
@@ -226,7 +226,7 @@ public class MessageSendService {
while (true) { while (true) {
List<ListSearchService.DownloadListRow> rows = listSearchService.findDownloadListRows( List<ListSearchService.DownloadListRow> rows = listSearchService.findDownloadListRows(
prjctIdx, prjctIdx,
request.getListFilter(), request.listFilter(),
lastSid lastSid
); );
if (rows.isEmpty()) { if (rows.isEmpty()) {
@@ -235,8 +235,8 @@ public class MessageSendService {
destInfos.addAll(createDestInfos( destInfos.addAll(createDestInfos(
rows, rows,
request.getDestHeaderIds(), request.destHeaderIds(),
request.getDestNameHeaderId(), request.destNameHeaderId(),
messageContext, messageContext,
channelType, channelType,
dedupeKeys, dedupeKeys,
@@ -291,8 +291,8 @@ public class MessageSendService {
} }
NotiHubTemplateDto template = notiHubApiClient.getTemplate(tmplatIdx); NotiHubTemplateDto template = notiHubApiClient.getTemplate(tmplatIdx);
Set<String> titleParams = extractTemplateParams(template.getTmplatTitle()); Set<String> titleParams = extractTemplateParams(template.tmplatTitle());
Set<String> bodyParams = extractTemplateParams(template.getTmplatBody()); Set<String> bodyParams = extractTemplateParams(template.tmplatBody());
Set<String> templateParams = SetUtils.union(titleParams, bodyParams); Set<String> templateParams = SetUtils.union(titleParams, bodyParams);
Map<Integer, ListHeaderDto> headerById = listHeaderService.getHeader(prjctIdx).stream() Map<Integer, ListHeaderDto> headerById = listHeaderService.getHeader(prjctIdx).stream()
@@ -357,9 +357,9 @@ public class MessageSendService {
.reqstUser(ctx == null ? null : ctx.getUserId()) .reqstUser(ctx == null ? null : ctx.getUserId())
.reqstSvc(REQUEST_SERVICE) .reqstSvc(REQUEST_SERVICE)
.prjctCd(messageContext.project().getPrjctCd()) .prjctCd(messageContext.project().getPrjctCd())
.tmplatIdx(request.getTmplatIdx()) .tmplatIdx(request.tmplatIdx())
.resve(request.getResve()) .resve(request.resve())
.sendDt(request.getSendDt()) .sendDt(request.sendDt())
.trgtCnt(targetCount) .trgtCnt(targetCount)
.build(); .build();
@@ -531,19 +531,19 @@ public class MessageSendService {
) {} ) {}
public MessageContext prepareAsync(Long projectId, MessageSendBulkRequestDto request) { public MessageContext prepareAsync(Long projectId, MessageSendBulkRequestDto request) {
validateDestinationHeaders(request.getDestHeaderIds()); validateDestinationHeaders(request.destHeaderIds());
return createMessageContext(projectId, request.getTmplatIdx(), request.getDestHeaderIds()); return createMessageContext(projectId, request.tmplatIdx(), request.destHeaderIds());
} }
public List<NotiHubDestInfoDto> prepareAsyncRow(ListSearchService.DownloadListRow row, public List<NotiHubDestInfoDto> prepareAsyncRow(ListSearchService.DownloadListRow row,
MessageSendBulkRequestDto request, MessageContext context, ChannelType channel) { MessageSendBulkRequestDto request, MessageContext context, ChannelType channel) {
return createDestInfos(List.of(row), request.getDestHeaderIds(), request.getDestNameHeaderId(), return createDestInfos(List.of(row), request.destHeaderIds(), request.destNameHeaderId(),
context, channel, new HashSet<>(), false); context, channel, new HashSet<>(), false);
} }
public boolean retainAsyncDestination(NotiHubDestInfoDto destination, ChannelType channel, public boolean retainAsyncDestination(NotiHubDestInfoDto destination, ChannelType channel,
Set<String> keys, boolean dedupe) { Set<String> keys, boolean dedupe) {
String value = channel == ChannelType.EMAIL ? destination.getDestEml() : destination.getDestTel(); String value = channel == ChannelType.EMAIL ? destination.destEml() : destination.destTel();
return !isDuplicateDestination(value, channel, keys, dedupe); return !isDuplicateDestination(value, channel, keys, dedupe);
} }

View File

@@ -186,10 +186,10 @@ public class ProgressService {
return new SearchCondition(null, null, null, null); return new SearchCondition(null, null, null, null);
} }
return new SearchCondition( return new SearchCondition(
normalizeBlank(request.getUserId()), normalizeBlank(request.userId()),
normalizeBlank(request.getCmpnId()), normalizeBlank(request.cmpnId()),
parseStartDateTime(request.getStartDt()), parseStartDateTime(request.startDt()),
parseEndDateTime(request.getEndDt()) parseEndDateTime(request.endDt())
); );
} }
} }

View File

@@ -71,7 +71,7 @@ public class ProjectService {
String regUser, String regUser,
LocalDateTime regDt LocalDateTime regDt
) { ) {
String itrnt = req.getItrntPrjctCd(); String itrnt = req.itrntPrjctCd();
try { try {
String prjctCd = this.makePrjctCd(itrnt); String prjctCd = this.makePrjctCd(itrnt);
@@ -140,11 +140,11 @@ public class ProjectService {
String userTeam, String userTeam,
Integer userRole Integer userRole
) { ) {
Specification<TPrjctEntity> spec = ProjectSpecs.keywordLike(req.getPrjctText()) Specification<TPrjctEntity> spec = ProjectSpecs.keywordLike(req.prjctText())
.and(ProjectSpecs.isDelFalse()) .and(ProjectSpecs.isDelFalse())
.and(ProjectSpecs.statusIn(req.getPrjctStatusList())) .and(ProjectSpecs.statusIn(req.prjctStatusList()))
.and(ProjectSpecs.ownerDeptIn(req.getOwnerDeptList())) .and(ProjectSpecs.ownerDeptIn(req.ownerDeptList()))
.and(ProjectSpecs.ownerFwIn(req.getOwnerFwList())); .and(ProjectSpecs.ownerFwIn(req.ownerFwList()));
if (isTeamUserRole(userRole)) { if (isTeamUserRole(userRole)) {
spec = spec.and(ProjectSpecs.ownerDeptEqual(userTeam)); spec = spec.and(ProjectSpecs.ownerDeptEqual(userTeam));
@@ -159,7 +159,7 @@ public class ProjectService {
: ProjectSpecs.assignedToCmpn(userCmpn)); : ProjectSpecs.assignedToCmpn(userCmpn));
} }
PageRequestDto pageReq = req.getPageRequest(); PageRequestDto pageReq = req.pageRequest();
Pageable pageable = Pageables.of(pageReq, TPrjctEntity.class, Map.of( Pageable pageable = Pageables.of(pageReq, TPrjctEntity.class, Map.of(
"prjctName", "prjctNm" "prjctName", "prjctNm"
)); ));
@@ -178,10 +178,10 @@ public class ProjectService {
} }
public ProjectOwnerResponseDto getOwnerList(Integer userRole) { public ProjectOwnerResponseDto getOwnerList(Integer userRole) {
ProjectOwnerResponseDto responseDto = new ProjectOwnerResponseDto(); return new ProjectOwnerResponseDto(
responseDto.setOwnerDeptList(this.getOwnerDeptList(userRole)); this.getOwnerDeptList(userRole),
responseDto.setOwnerFwList(this.getOwnerFwList(userRole)); this.getOwnerFwList(userRole)
return responseDto; );
} }
public List<String> getOwnerDeptList(Integer userRole) { public List<String> getOwnerDeptList(Integer userRole) {
@@ -214,27 +214,27 @@ public class ProjectService {
.orElseThrow(() -> BusinessException.notFound("PROJECT_NOT_FOUND", "프로젝트를 찾을 수 없습니다.") .orElseThrow(() -> BusinessException.notFound("PROJECT_NOT_FOUND", "프로젝트를 찾을 수 없습니다.")
.with("prjctIdx", prjctIdx)); .with("prjctIdx", prjctIdx));
entity.updateFrom(req.getProjectInfo(), modUser, modDt); entity.updateFrom(req.projectInfo(), modUser, modDt);
SurveyMappingSyncPlan surveyMappingSyncPlan = updateProjectSurveys( SurveyMappingSyncPlan surveyMappingSyncPlan = updateProjectSurveys(
prjctIdx, prjctIdx,
req.getProjectInfo().getSurveys(), req.projectInfo().getSurveys(),
modUser, modUser,
modDt, modDt,
ctx ctx
); );
assignService.upsertPrjctCmpnAssign(prjctIdx, req.getAssignCmpnIdList(), modUser, modDt); assignService.upsertPrjctCmpnAssign(prjctIdx, req.assignCmpnIdList(), modUser, modDt);
resultCodeService.updateResultCode(prjctIdx, req.getResultCodeList(), modUser, modDt); resultCodeService.updateResultCode(prjctIdx, req.resultCodeList(), modUser, modDt);
synchronizeSurveyMappings(surveyMappingSyncPlan); synchronizeSurveyMappings(surveyMappingSyncPlan);
} }
@Transactional @Transactional
public void updateProjectMainTemplate(ProjectMainTemplateUpdateRequestDto req, String modUser, public void updateProjectMainTemplate(ProjectMainTemplateUpdateRequestDto req, String modUser,
LocalDateTime modDt) { LocalDateTime modDt) {
Short chnnlTy = req.getChnnlTy().getCode(); Short chnnlTy = req.chnnlTy().getCode();
projectMainTemplateRepository.deleteByIdPrjctIdxAndIdChnnlTy(req.getPrjctIdx(), chnnlTy); projectMainTemplateRepository.deleteByIdPrjctIdxAndIdChnnlTy(req.prjctIdx(), chnnlTy);
if (req.getTmplatIdx() == null) { if (req.tmplatIdx() == null) {
return; return;
} }

View File

@@ -31,19 +31,19 @@ public class ReserveService {
@Transactional @Transactional
public ListReserveDto reserve(ListReserveRequestDto request, String regUser, LocalDateTime regDt) { public ListReserveDto reserve(ListReserveRequestDto request, String regUser, LocalDateTime regDt) {
if (!listRepository.existsByIdPrjctIdxAndIdSid(request.getPrjctIdx(), request.getSid())) { if (!listRepository.existsByIdPrjctIdxAndIdSid(request.prjctIdx(), request.sid())) {
throw BusinessException.notFound("LIST_NOT_FOUND", "예약 대상 리스트를 찾을 수 없습니다.") throw BusinessException.notFound("LIST_NOT_FOUND", "예약 대상 리스트를 찾을 수 없습니다.")
.with("prjctIdx", request.getPrjctIdx()) .with("prjctIdx", request.prjctIdx())
.with("sid", request.getSid()); .with("sid", request.sid());
} }
TListResveEntity entity = new TListResveEntity(); TListResveEntity entity = new TListResveEntity();
entity.setPrjctIdx(request.getPrjctIdx()); entity.setPrjctIdx(request.prjctIdx());
entity.setSid(request.getSid()); entity.setSid(request.sid());
entity.setMemo(""); entity.setMemo("");
entity.setCnfirm(false); entity.setCnfirm(false);
entity.setResveDt(request.getResveDt()); entity.setResveDt(request.resveDt());
entity.setResveUser(request.getUserId().trim()); entity.setResveUser(request.userId().trim());
entity.setRegUser(regUser == null || regUser.isBlank() ? ContactConstant.SYSTEM_USER_NAME : regUser); entity.setRegUser(regUser == null || regUser.isBlank() ? ContactConstant.SYSTEM_USER_NAME : regUser);
entity.setRegDt(regDt); entity.setRegDt(regDt);
TListResveEntity saved = listReserveRepository.save(entity); TListResveEntity saved = listReserveRepository.save(entity);

View File

@@ -65,8 +65,8 @@ public class ResultCodeService {
LocalDateTime modDt) { LocalDateTime modDt) {
if (resultCodeDtoList != null && !resultCodeDtoList.isEmpty()) { if (resultCodeDtoList != null && !resultCodeDtoList.isEmpty()) {
Map<ResultCodeType, List<ResultCodeDto>> dtoGroupByType = resultCodeDtoList.stream() Map<ResultCodeType, List<ResultCodeDto>> dtoGroupByType = resultCodeDtoList.stream()
.filter(dto -> dto.getResultCdTy() != null) .filter(dto -> dto.resultCdTy() != null)
.collect(Collectors.groupingBy(ResultCodeDto::getResultCdTy)); .collect(Collectors.groupingBy(ResultCodeDto::resultCdTy));
dtoGroupByType.forEach((resultCdTy, dtos) -> dtoGroupByType.forEach((resultCdTy, dtos) ->
replaceResultCodes(prjctIdx, resultCdTy, dtos, modUser, modDt) replaceResultCodes(prjctIdx, resultCdTy, dtos, modUser, modDt)
@@ -86,8 +86,8 @@ public class ResultCodeService {
resultCodeRepository.deleteEditableByPrjctIdxAndResultCdTy(prjctIdx, resultCdTy); resultCodeRepository.deleteEditableByPrjctIdxAndResultCdTy(prjctIdx, resultCdTy);
List<TResultCodeEntity> entities = dtos.stream() List<TResultCodeEntity> entities = dtos.stream()
.filter(dto -> dto.getResultCd() != null) .filter(dto -> dto.resultCd() != null)
.filter(dto -> !defaultCodes.contains(dto.getResultCd())) .filter(dto -> !defaultCodes.contains(dto.resultCd()))
.map(dto -> TResultCodeEntity.fromDto(prjctIdx, resultCdTy, dto, userId, modDt)) .map(dto -> TResultCodeEntity.fromDto(prjctIdx, resultCdTy, dto, userId, modDt))
.toList(); .toList();

View File

@@ -48,10 +48,10 @@ public class UserService {
userInfo.setUserId(userInfo.getUserId().toLowerCase()); userInfo.setUserId(userInfo.getUserId().toLowerCase());
List<DataVerificationDto> failList = validateUserDto(userInfo, roleList, List<DataVerificationDto> failList = validateUserDto(userInfo, roleList,
intranetUserList).stream().filter(dto -> !dto.isSuccess()).toList(); intranetUserList).stream().filter(dto -> !dto.success()).toList();
if (!failList.isEmpty()) { if (!failList.isEmpty()) {
DataVerificationDto firstFail = failList.get(0); DataVerificationDto firstFail = failList.get(0);
throw BusinessException.badRequest("WRONG_USER_DATA", firstFail.getErrMessage()); throw BusinessException.badRequest("WRONG_USER_DATA", firstFail.errMessage());
} }
TUserEntity entity = TUserEntity.fromDto(userInfo, regUser, regDt); TUserEntity entity = TUserEntity.fromDto(userInfo, regUser, regDt);
@@ -90,8 +90,8 @@ public class UserService {
for (int i = 0; i < rows.size(); i++) { for (int i = 0; i < rows.size(); i++) {
UserUploadDto uploadDto = rows.get(i); UserUploadDto uploadDto = rows.get(i);
Integer roleCd = roleList.stream() Integer roleCd = roleList.stream()
.filter(r -> java.util.Objects.equals(uploadDto.getUserRoleStr(), r.getRoleNm())) .filter(r -> java.util.Objects.equals(uploadDto.getUserRoleStr(), r.roleNm()))
.map(RoleInfoDto::getRoleCd) .map(RoleInfoDto::roleCd)
.findFirst() .findFirst()
.orElse(null); .orElse(null);
@@ -359,7 +359,7 @@ public class UserService {
Integer userRole = dto.getUserRole(); Integer userRole = dto.getUserRole();
if (roleList != null && !roleList.isEmpty()) { if (roleList != null && !roleList.isEmpty()) {
boolean exists = roleList.stream() boolean exists = roleList.stream()
.anyMatch(r -> userRole != null && userRole.equals(r.getRoleCd())); .anyMatch(r -> userRole != null && userRole.equals(r.roleCd()));
if (!exists) { if (!exists) {
result.add(new DataVerificationDto( result.add(new DataVerificationDto(
@@ -385,12 +385,12 @@ public class UserService {
intranetUserList); intranetUserList);
validateUserList.forEach(validateResult -> { validateUserList.forEach(validateResult -> {
if (!validateResult.isSuccess()) { if (!validateResult.success()) {
errors.add(UserUploadErrorDto.of( errors.add(UserUploadErrorDto.of(
rowNumber, rowNumber,
dto.getUserId(), dto.getUserId(),
validateResult.getFieldName(), validateResult.fieldName(),
validateResult.getErrMessage() validateResult.errMessage()
)); ));
} }
}); });

View File

@@ -36,17 +36,17 @@ public class ListAsyncDownloadService {
public ListAsyncJobAcceptedDto eventHistory(Long projectId, public ListAsyncJobAcceptedDto eventHistory(Long projectId,
ListEventHistDownloadRequestDto request, boolean includeResult, RequestUserContext user) { ListEventHistDownloadRequestDto request, boolean includeResult, RequestUserContext user) {
if (request == null || request.getSearchBase() == null if (request == null || request.searchBase() == null
|| request.getResultCodeTypes() == null || request.getResultCodeTypes().isEmpty()) { || request.resultCodeTypes() == null || request.resultCodeTypes().isEmpty()) {
throw BusinessException.badRequest("INVALID_HISTORY_DOWNLOAD", "이력 다운로드 조건이 필요합니다."); throw BusinessException.badRequest("INVALID_HISTORY_DOWNLOAD", "이력 다운로드 조건이 필요합니다.");
} }
var dates = request.getDateRange(); var dates = request.dateRange();
if (dates != null && dates.getStartDate() != null && dates.getEndDate() != null if (dates != null && dates.startDate() != null && dates.endDate() != null
&& dates.getStartDate().isAfter(dates.getEndDate())) { && dates.startDate().isAfter(dates.endDate())) {
throw BusinessException.badRequest("INVALID_DATE_RANGE", "시작일은 종료일보다 늦을 수 없습니다."); throw BusinessException.badRequest("INVALID_DATE_RANGE", "시작일은 종료일보다 늦을 수 없습니다.");
} }
return submit(projectId, ListAsyncJobType.CONTACT_HISTORY_DOWNLOAD, return submit(projectId, ListAsyncJobType.CONTACT_HISTORY_DOWNLOAD,
request.getListFilter(), includeResult, request, user); request.listFilter(), includeResult, request, user);
} }
public ListAsyncJobAcceptedDto updateHistory(Long projectId, ListFilterDto filter, public ListAsyncJobAcceptedDto updateHistory(Long projectId, ListFilterDto filter,
@@ -114,8 +114,8 @@ public class ListAsyncDownloadService {
switch (type) { switch (type) {
case LIST_DOWNLOAD -> downloads.writeList(projectId, filter, includeResult, checked, observer); case LIST_DOWNLOAD -> downloads.writeList(projectId, filter, includeResult, checked, observer);
case CONTACT_HISTORY_DOWNLOAD -> downloads.writeListWithEventHist(projectId, filter, case CONTACT_HISTORY_DOWNLOAD -> downloads.writeListWithEventHist(projectId, filter,
event.getResultCodeTypes(), event.getSearchBase(), event.getDateRange(), event.resultCodeTypes(), event.searchBase(), event.dateRange(),
event.getHistoryOrder(), includeResult, checked, observer); event.historyOrder(), includeResult, checked, observer);
case UPDATE_HISTORY_DOWNLOAD -> downloads.writeSidWithUpdateHist(projectId, filter, checked, observer); case UPDATE_HISTORY_DOWNLOAD -> downloads.writeSidWithUpdateHist(projectId, filter, checked, observer);
case ITEM_ZIP_DOWNLOAD -> downloads.writeItemFile(projectId, filter, checked, observer); case ITEM_ZIP_DOWNLOAD -> downloads.writeItemFile(projectId, filter, checked, observer);
default -> throw BusinessException.internalError("UNSUPPORTED_LIST_DOWNLOAD_TYPE", "Unsupported download type"); default -> throw BusinessException.internalError("UNSUPPORTED_LIST_DOWNLOAD_TYPE", "Unsupported download type");

View File

@@ -87,7 +87,7 @@ public class ListAsyncMaintenanceService {
public ListAsyncJobAcceptedDto upload(Long projectId, MultipartFile file, ListUploadRequestDto request, public ListAsyncJobAcceptedDto upload(Long projectId, MultipartFile file, ListUploadRequestDto request,
RequestUserContext user) { RequestUserContext user) {
access.requireProject(projectId, user); access.requireProject(projectId, user);
if (request == null || request.getUploadMode() == null) { if (request == null || request.uploadMode() == null) {
throw BusinessException.badRequest("ASYNC_UPLOAD_MODE_REQUIRED", "업로드 모드가 필요합니다."); throw BusinessException.badRequest("ASYNC_UPLOAD_MODE_REQUIRED", "업로드 모드가 필요합니다.");
} }
var saved = mapper.convertValue(request, ListUploadRequestDto.class); var saved = mapper.convertValue(request, ListUploadRequestDto.class);
@@ -103,7 +103,7 @@ public class ListAsyncMaintenanceService {
job.setListUploadLogId(uploads.createPendingLog(projectId, source, saved, user.getUserId(), job.setListUploadLogId(uploads.createPendingLog(projectId, source, saved, user.getUserId(),
job.getRegDt()).getListUploadLogId()); job.getRegDt()).getListUploadLogId());
job.setListResetLogId(resets.createResetLog(projectId, job.setListResetLogId(resets.createResetLog(projectId,
saved.getUploadMode() == ListUploadMode.RESET_AND_INSERT ? ListResetMode.ALL : ListResetMode.LIST_UPLOAD, 0, saved.uploadMode() == ListUploadMode.RESET_AND_INSERT ? ListResetMode.ALL : ListResetMode.LIST_UPLOAD, 0,
user.getUserId(), job.getRegDt())); user.getUserId(), job.getRegDt()));
initialized.set(true); initialized.set(true);
}); });
@@ -139,7 +139,7 @@ public class ListAsyncMaintenanceService {
} }
context.progress("PROCESSING", (long) prepared.sids().size(), Map.of("validationRowCnt", prepared.totalCount())); context.progress("PROCESSING", (long) prepared.sids().size(), Map.of("validationRowCnt", prepared.totalCount()));
var number = new AtomicInteger(); var number = new AtomicInteger();
boolean fullReset = request.getUploadMode() == ListUploadMode.RESET_AND_INSERT; boolean fullReset = request.uploadMode() == ListUploadMode.RESET_AND_INSERT;
if (fullReset && !clearBeforeInsert(projectId, prepared.sids().size(), job.getListResetLogId(), user, context, number)) return; if (fullReset && !clearBeforeInsert(projectId, prepared.sids().size(), job.getListResetLogId(), user, context, number)) return;
var attempted = new AtomicInteger(); var attempted = new AtomicInteger();
var failed = new AtomicInteger(); var failed = new AtomicInteger();

View File

@@ -36,14 +36,14 @@ public class ListAsyncMessageService {
public ListAsyncJobAcceptedDto submit(Long projectId, ChannelType channel, MessageSendBulkRequestDto request, public ListAsyncJobAcceptedDto submit(Long projectId, ChannelType channel, MessageSendBulkRequestDto request,
RequestUserContext user) { RequestUserContext user) {
access.requireProject(projectId, user); access.requireProject(projectId, user);
if (channel == null || request == null || request.getTmplatIdx() == null || request.getResve() == null if (channel == null || request == null || request.tmplatIdx() == null || request.resve() == null
|| request.getDestHeaderIds() == null || request.getDestHeaderIds().isEmpty() || request.destHeaderIds() == null || request.destHeaderIds().isEmpty()
|| request.getDestHeaderIds().stream().anyMatch(Objects::isNull) || request.destHeaderIds().stream().anyMatch(Objects::isNull)
|| Boolean.TRUE.equals(request.getResve()) && request.getSendDt() == null) { || Boolean.TRUE.equals(request.resve()) && request.sendDt() == null) {
throw BusinessException.badRequest("INVALID_MESSAGE_REQUEST", "템플릿·수신처·예약 조건을 확인해 주세요."); throw BusinessException.badRequest("INVALID_MESSAGE_REQUEST", "템플릿·수신처·예약 조건을 확인해 주세요.");
} }
var saved = mapper.convertValue(request, MessageSendBulkRequestDto.class); var saved = mapper.convertValue(request, MessageSendBulkRequestDto.class);
requireValidFilterConditions(saved.getListFilter() == null ? null : saved.getListFilter().getSidSet()); requireValidFilterConditions(saved.listFilter() == null ? null : saved.listFilter().getSidSet());
var type = switch (channel) { case EMAIL -> ListAsyncJobType.EMAIL_BULK; case SMS -> ListAsyncJobType.SMS_BULK; case KKO_AT -> ListAsyncJobType.KKO_BULK; }; var type = switch (channel) { case EMAIL -> ListAsyncJobType.EMAIL_BULK; case SMS -> ListAsyncJobType.SMS_BULK; case KKO_AT -> ListAsyncJobType.KKO_BULK; };
Map<String,Object> snapshot = mapper.convertValue(saved, new TypeReference<>() {}); Map<String,Object> snapshot = mapper.convertValue(saved, new TypeReference<>() {});
return new ListAsyncJobAcceptedDto(executor.submit(projectId, user.getUserId(), type, snapshot, null, return new ListAsyncJobAcceptedDto(executor.submit(projectId, user.getUserId(), type, snapshot, null,
@@ -54,7 +54,7 @@ public class ListAsyncMessageService {
RequestUserContext user, ListAsyncJobExecutor.JobContext context) { RequestUserContext user, ListAsyncJobExecutor.JobContext context) {
access.requireProject(projectId, user); access.requireProject(projectId, user);
context.progress("FREEZING_SIDS", null, Map.of()); context.progress("FREEZING_SIDS", null, Map.of());
var frozen = List.copyOf(search.findTargetSids(projectId, request.getListFilter())); var frozen = List.copyOf(search.findTargetSids(projectId, request.listFilter()));
context.progress("PREPARING_MESSAGES", null, Map.of("targetSidCnt", frozen.size())); context.progress("PREPARING_MESSAGES", null, Map.of("targetSidCnt", frozen.size()));
var messageContext = messages.prepareAsync(projectId, request); var messageContext = messages.prepareAsync(projectId, request);
var failures = new ArrayList<Map<String,Object>>(); var failures = new ArrayList<Map<String,Object>>();
@@ -94,12 +94,12 @@ public class ListAsyncMessageService {
failedSids.add(row.sid()); failedSids.add(row.sid());
} }
for (var destination : candidates) { for (var destination : candidates) {
if (channel == ChannelType.EMAIL && com.kri.common.feature.util.StringUtil.normalizeEmail(destination.getDestEml()) == null) { if (channel == ChannelType.EMAIL && com.kri.common.feature.util.StringUtil.normalizeEmail(destination.destEml()) == null) {
failures.add(Map.of("code", "INVALID_DESTINATION", "sids", List.of(row.sid()))); failures.add(Map.of("code", "INVALID_DESTINATION", "sids", List.of(row.sid())));
failedSids.add(row.sid()); failedSids.add(row.sid());
continue; continue;
} }
if (!messages.retainAsyncDestination(destination, channel, keys, Boolean.TRUE.equals(request.getDedupe()))) { duplicates++; continue; } if (!messages.retainAsyncDestination(destination, channel, keys, request.dedupe())) { duplicates++; continue; }
buffer.add(destination); buffer.add(destination);
if (buffer.size() == 1000) { prepared.append(buffer); buffer.clear(); } if (buffer.size() == 1000) { prepared.append(buffer); buffer.clear(); }
} }
@@ -188,15 +188,15 @@ public class ListAsyncMessageService {
} }
private Map<String,Object> response(List<NotiHubDestInfoDto> batch, String key, NotiHubBulkSendResponseDto value) { private Map<String,Object> response(List<NotiHubDestInfoDto> batch, String key, NotiHubBulkSendResponseDto value) {
if (value == null || value.getRequestCount() == null || value.getAcceptCount() == null || value.getFailCount() == null if (value == null || value.requestCount() == null || value.acceptCount() == null || value.failCount() == null
|| value.getRequestCount() != batch.size() || value.getAcceptCount() < 0 || value.getFailCount() < 0 || value.requestCount() != batch.size() || value.acceptCount() < 0 || value.failCount() < 0
|| (long) value.getAcceptCount() + value.getFailCount() > batch.size() || (long) value.acceptCount() + value.failCount() > batch.size()
|| value.getBulkSendKey() != null && !key.equals(value.getBulkSendKey())) { || value.bulkSendKey() != null && !key.equals(value.bulkSendKey())) {
return outcome(batch, key, "INVALID_RESPONSE", 0, 0, batch.size(), true, true); return outcome(batch, key, "INVALID_RESPONSE", 0, 0, batch.size(), true, true);
} }
int unknown = batch.size() - value.getAcceptCount() - value.getFailCount(); int unknown = batch.size() - value.acceptCount() - value.failCount();
return outcome(batch, key, unknown > 0 ? "UNKNOWN" : value.getFailCount() > 0 ? value.getAcceptCount() > 0 ? "PARTIAL" : "REJECTED" : "ACCEPTED", return outcome(batch, key, unknown > 0 ? "UNKNOWN" : value.failCount() > 0 ? value.acceptCount() > 0 ? "PARTIAL" : "REJECTED" : "ACCEPTED",
value.getAcceptCount(), value.getFailCount(), unknown, true, true); value.acceptCount(), value.failCount(), unknown, true, true);
} }
private Map<String,Object> outcome(List<NotiHubDestInfoDto> batch, String key, String status, private Map<String,Object> outcome(List<NotiHubDestInfoDto> batch, String key, String status,
@@ -204,7 +204,7 @@ public class ListAsyncMessageService {
var values = new LinkedHashMap<String,Object>(); var values = new LinkedHashMap<String,Object>();
values.put("bulkSendKey", key); values.put("bulkSendKey", key);
values.put("status", status); values.put("status", status);
values.put("sids", batch.stream().map(NotiHubDestInfoDto::getSid).distinct().toList()); values.put("sids", batch.stream().map(NotiHubDestInfoDto::sid).distinct().toList());
values.put("targetRecipientCnt", batch.size()); values.put("targetRecipientCnt", batch.size());
values.put("acceptedRecipientCnt", accepted); values.put("acceptedRecipientCnt", accepted);
values.put("failedRecipientCnt", failed); values.put("failedRecipientCnt", failed);

View File

@@ -102,7 +102,7 @@ public class SystemEventLogService {
public void writeUpdateDefaultMessageTemplate(String regId, LocalDateTime regDt, String clientIp, public void writeUpdateDefaultMessageTemplate(String regId, LocalDateTime regDt, String clientIp,
ProjectMainTemplateUpdateRequestDto req) { ProjectMainTemplateUpdateRequestDto req) {
writeSystemLog(SystemEventType.UPDATE_PROJECT_DEFAULT_TEMPLATE, writeSystemLog(SystemEventType.UPDATE_PROJECT_DEFAULT_TEMPLATE,
"Update Project Default Message Template", req.getPrjctIdx(), regId, regDt, clientIp, req); "Update Project Default Message Template", req.prjctIdx(), regId, regDt, clientIp, req);
} }
public void writeDeleteProject(String regId, LocalDateTime regDt, String clientIp, public void writeDeleteProject(String regId, LocalDateTime regDt, String clientIp,

View File

@@ -20,7 +20,7 @@ public class ListAsyncMessageSpool {
public record Destination(String sid, String destEml, String destTel, String destNm, Map<String,String> msgParam) { public record Destination(String sid, String destEml, String destTel, String destNm, Map<String,String> msgParam) {
static Destination from(NotiHubDestInfoDto value) { static Destination from(NotiHubDestInfoDto value) {
return new Destination(value.getSid(), value.getDestEml(), value.getDestTel(), value.getDestNm(), value.getMsgParam()); return new Destination(value.sid(), value.destEml(), value.destTel(), value.destNm(), value.msgParam());
} }
NotiHubDestInfoDto toRequest() { NotiHubDestInfoDto toRequest() {
return NotiHubDestInfoDto.builder().sid(sid).destEml(destEml).destTel(destTel).destNm(destNm).msgParam(msgParam).build(); return NotiHubDestInfoDto.builder().sid(sid).destEml(destEml).destTel(destTel).destNm(destNm).msgParam(msgParam).build();