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;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@Builder
@NoArgsConstructor // Jackson이 빈 객체를 생성할 수 있도록 추가
@AllArgsConstructor // Builder 패턴 사용 시 필요
@Schema(description = "인트라넷 사용자 검색 응답 DTO")
public class SearchLoginInfoResponseDto {
public record SearchLoginInfoResponseDto(
@Schema(description = "사용자 ID")
private String userId;
String userId,
@Schema(description = "사용자 소속 회사")
private String userCmpn;
String userCmpn,
@Schema(description = "사용자 이름")
private String userNm;
String userNm,
@Schema(description = "사용자 팀")
private String userTeam;
String userTeam,
@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 lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "NotiHubBulkSendCreateRequestDto")
public class NotiHubBulkSendCreateRequestDto {
public record NotiHubBulkSendCreateRequestDto(
@Schema(description = "reqstCmpn")
private String reqstCmpn;
String reqstCmpn,
@Schema(description = "reqstUser")
private String reqstUser;
String reqstUser,
@Schema(description = "reqstSvc")
private String reqstSvc;
String reqstSvc,
@Schema(description = "prjctCd")
private String prjctCd;
String prjctCd,
@Schema(description = "tmplatIdx")
private Long tmplatIdx;
Long tmplatIdx,
@Schema(description = "resve")
private Boolean resve;
Boolean resve,
@Schema(description = "sendDt")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime sendDt;
LocalDateTime sendDt,
@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 com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubBulkSendResponseDto")
public class NotiHubBulkSendResponseDto {
public record NotiHubBulkSendResponseDto(
@Schema(description = "bulkSendKey")
private String bulkSendKey;
String bulkSendKey,
@Schema(description = "requestCount")
private Integer requestCount;
Integer requestCount,
@Schema(description = "acceptCount")
private Integer acceptCount;
Integer acceptCount,
@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 lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "NotiHubDestInfoDto")
public class NotiHubDestInfoDto {
public record NotiHubDestInfoDto(
@Schema(description = "sid")
private String sid;
String sid,
@Schema(description = "destEml")
private String destEml;
String destEml,
@Schema(description = "destTel")
private String destTel;
String destTel,
@Schema(description = "destNm")
private String destNm;
String destNm,
@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.databind.JsonNode;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
public class NotiHubKkoTemplateDetailDto {
public record NotiHubKkoTemplateDetailDto(
private String templateCode;
private String templateName;
private String templateContent;
private String templatePreviewMessage;
private String templateMessageType;
private String templateEmphasizeType;
private String inspectionStatus;
private String status;
private Boolean block;
private Boolean dormant;
private String templateExtra;
private String templateImageName;
private String templateImageUrl;
private String templateTitle;
private String templateSubtitle;
private String templateHeader;
private JsonNode templateItemHighlight;
private JsonNode templateItem;
private JsonNode templateRepresentLink;
private List<JsonNode> buttons;
private List<JsonNode> quickReplies;
String templateCode,
String templateName,
String templateContent,
String templatePreviewMessage,
String templateMessageType,
String templateEmphasizeType,
String inspectionStatus,
String status,
Boolean block,
Boolean dormant,
String templateExtra,
String templateImageName,
String templateImageUrl,
String templateTitle,
String templateSubtitle,
String templateHeader,
JsonNode templateItemHighlight,
JsonNode templateItem,
JsonNode templateRepresentLink,
List<JsonNode> buttons,
List<JsonNode> quickReplies
) {
}

View File

@@ -3,19 +3,12 @@ package com.kri.contact.server.common.external.notihub.dto;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class NotiHubKkoTemplateDetailRequestDto {
public record NotiHubKkoTemplateDetailRequestDto(
@NotBlank
@Size(max = 30)
@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;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@NoArgsConstructor
public class NotiHubKkoTemplateListRequestDto {
public record NotiHubKkoTemplateListRequestDto(
@Size(min = 2, max = 50)
private String keyword;
String keyword
) {
public NotiHubKkoTemplateListRequestDto(String keyword) {
setKeyword(keyword);
}
public void setKeyword(String keyword) {
this.keyword = keyword == null || keyword.isBlank() ? null : keyword.trim();
public NotiHubKkoTemplateListRequestDto {
keyword = keyword == null || keyword.isBlank() ? null : keyword.trim();
}
}

View File

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

View File

@@ -1,21 +1,18 @@
package com.kri.contact.server.common.external.notihub.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class NotiHubKkoTemplateSummaryDto {
public record NotiHubKkoTemplateSummaryDto(
private String templateCode;
private String templateName;
private String serviceStatus;
private String createdAt;
private String modifiedAt;
String templateCode,
String templateName,
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 lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "NotiHubSendRequestBulkDto")
public class NotiHubSendRequestBulkDto {
public record NotiHubSendRequestBulkDto(
@Schema(description = "sendEml")
private String sendEml;
String sendEml,
@Schema(description = "sendTel")
private String sendTel;
String sendTel,
@Schema(description = "sendNm")
private String sendNm;
String sendNm,
@Schema(description = "bulkSendKey")
private String bulkSendKey;
String bulkSendKey,
@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 lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "NotiHubSendRequestSingleDto")
public class NotiHubSendRequestSingleDto {
public record NotiHubSendRequestSingleDto(
@Schema(description = "sendEml")
private String sendEml;
String sendEml,
@Schema(description = "sendTel")
private String sendTel;
String sendTel,
@Schema(description = "sendNm")
private String sendNm;
String sendNm,
@Schema(description = "destInfo")
private NotiHubDestInfoDto destInfo;
NotiHubDestInfoDto destInfo,
@Schema(description = "tmplatIdx")
private Long tmplatIdx;
Long tmplatIdx,
@Schema(description = "reqstSvc")
private String reqstSvc;
String reqstSvc,
@Schema(description = "prjctCd")
private String prjctCd;
String prjctCd,
@Schema(description = "resve")
private Boolean resve;
Boolean resve,
@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 io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubSendResultLastWithSidDto")
public class NotiHubSendResultLastWithSidDto {
public record NotiHubSendResultLastWithSidDto(
@Schema(description = "sid")
private String sid;
String sid,
@Schema(description = "lastResultCode")
private Integer lastResultCode;
Integer lastResultCode,
@Schema(description = "lastResultLabel")
private String lastResultLabel;
String lastResultLabel,
@Schema(description = "lastResultViewLabel")
private String lastResultViewLabel;
String lastResultViewLabel,
@Schema(description = "lastSendDt")
private LocalDateTime lastSendDt;
LocalDateTime lastSendDt,
@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 io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubSendSingleResponseDto")
public class NotiHubSendSingleResponseDto {
public record NotiHubSendSingleResponseDto(
@Schema(description = "cmid")
private String cmid;
String cmid,
@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 com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubTemplateDto")
public class NotiHubTemplateDto {
public record NotiHubTemplateDto(
@Schema(description = "tmplatIdx")
private Long tmplatIdx;
Long tmplatIdx,
@Schema(description = "tmplatPurpose")
private Integer tmplatPurpose;
Integer tmplatPurpose,
@Schema(description = "tmplatTitle")
private String tmplatTitle;
String tmplatTitle,
@Schema(description = "tmplatBody")
private String tmplatBody;
String tmplatBody,
@Schema(description = "sendTel")
private String sendTel;
String sendTel,
@Schema(description = "sendEml")
private String sendEml;
String sendEml,
@Schema(description = "sendNm")
private String sendNm;
String sendNm
) {
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -116,10 +116,10 @@ public class ProjectController {
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
String newHtml = contactScenarioFileService.syncOnSave(
req.getProjectInfo().getPrjctCd(),
req.getProjectInfo().getContactSenario()
req.projectInfo().getPrjctCd(),
req.projectInfo().getContactSenario()
);
req.getProjectInfo().setContactSenario(newHtml);
req.projectInfo().setContactSenario(newHtml);
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 lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "외주사별 리스트 배정 현황")
public class CompanyAssignSummaryItemDto {
public record CompanyAssignSummaryItemDto(
private String cmpnId;
private String cmpnAlias;
private long assignedCount;
String cmpnId,
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 lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "필드워커별 리스트 배정 현황")
public class FieldworkAssignSummaryItemDto {
public record FieldworkAssignSummaryItemDto(
private String userId;
private String userName;
private String userCmpn;
private long assignedCount;
String userId,
String userName,
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 java.util.List;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "프로젝트 외주사 리스트 배정 요약")
public class ProjectCompanyAssignSummaryDto {
public record ProjectCompanyAssignSummaryDto(
private long totalCount;
private long unassignedCount;
private List<CompanyAssignSummaryItemDto> assignees;
long totalCount,
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 java.util.List;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "프로젝트 필드워커 리스트 배정 요약")
public class ProjectFieldworkAssignSummaryDto {
public record ProjectFieldworkAssignSummaryDto(
private long totalCount;
private long unassignedCount;
private List<FieldworkAssignSummaryItemDto> assignees;
long totalCount,
long unassignedCount,
List<FieldworkAssignSummaryItemDto> assignees
) {
}

View File

@@ -1,17 +1,19 @@
package com.kri.contact.server.dto.auth;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "사용자 로그인 요청")
public class LoginRequestDto {
public record LoginRequestDto(
@Schema(description = "사용자 ID")
private String userId;
String userId,
@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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "로그인 응답")
public class LoginResponseDto {
public record LoginResponseDto(
@Schema(description = "jwt access 토큰")
private String accessToken;
String accessToken,
@Schema(description = "사용자 정보")
private JwtUserClaimsDto user;
JwtUserClaimsDto user
) {
public static LoginResponseDto from(String accessToken, JwtUserClaimsDto jwtUserClaims) {
return LoginResponseDto.builder()
@@ -23,4 +22,9 @@ public class LoginResponseDto {
.user(jwtUserClaims)
.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.Size;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "회사 정보")
public class CmpnInfoDto {
public record CmpnInfoDto(
@Size(max = 32)
@NotBlank
@Schema(description = "회사 id(회사이름)")
private String cmpnId;
String cmpnId,
@Size(max = 32)
@NotBlank
@Schema(description = "회사 별칭")
private String cmpnAlias;
String cmpnAlias,
@Size(max = 16)
@Schema(description = "회사 전화번호")
private String cmpnTel;
String cmpnTel,
@NotNull
@Schema(description = "자사 여부")
private Boolean ownCmpn;
Boolean ownCmpn,
@Schema(description = "메모")
private String memo;
String memo,
@Size(max = 32)
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String regUser;
String regUser,
@Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime regDt;
LocalDateTime regDt,
@Size(max = 32)
@Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String modUser;
String modUser,
@Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime modDt;
LocalDateTime modDt
) {
public static CmpnInfoDto from(TCmpnEntity entity) {
return CmpnInfoDto.builder()

View File

@@ -1,30 +1,40 @@
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 lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
@AllArgsConstructor
@JsonDeserialize(builder = DataVerificationDto.JsonBuilder.class)
@Schema(description = "데이터 검증에 대한 공용 Dto")
public class DataVerificationDto {
public record DataVerificationDto(
@Schema(description = "데이터 검증 통과 여부")
private boolean success;
boolean success,
@Schema(description = "검증 필드명")
private String fieldName;
String fieldName,
@Schema(description = "검증 메시지(error)")
private String errMessage;
String errMessage
) {
public DataVerificationDto() {
this.success = true;
this.fieldName = "";
this.errMessage = "";
this(true, "", "");
}
@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 java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "날짜 범위 Dto")
public class DateRangeDto {
public record DateRangeDto(
@Schema(description = "시작 날짜")
private LocalDateTime startDate;
LocalDateTime startDate,
@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 lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
@Schema(description = "ExcelUploadResultDto")
public class ExcelUploadResultDto {
public record ExcelUploadResultDto(
@Schema(description = "전체 읽은 행 수 (헤더 제외)")
private int totalCount;
int totalCount,
@Schema(description = "DB에 실제로 insert/update 성공한 개수")
private int successCount;
int successCount,
@Schema(description = "실패(에러) 개수")
private int failCount;
int failCount,
@Schema(description = "에러 엑셀 파일이 있는지 여부")
private boolean hasErrorFile;
boolean hasErrorFile,
@Schema(description = "프론트가 저장용으로 쓸 파일명")
private String errorFileName;
String errorFileName,
@Schema(description = "에러 엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)")
private String errorFileBase64;
String errorFileBase64
) {
public static ExcelUploadResultDto success(int totalCount, int successCount) {
return ExcelUploadResultDto.builder()
@@ -37,5 +34,4 @@ public class ExcelUploadResultDto {
.hasErrorFile(false)
.build();
}
}
}

View File

@@ -6,28 +6,23 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "마지막 이벤트 일자 필터 조건")
public class LastEventDateRangeDto {
public record LastEventDateRangeDto(
@NotNull
@Schema(description = "결과 코드 타입")
private ResultCodeType resultCodeType;
ResultCodeType resultCodeType,
@Schema(description = "프로젝트 설문 고유번호. SURVEY 타입인 경우 필수")
private Long prjctSurveyIdx;
Long prjctSurveyIdx,
@Schema(description = "시작 일시")
private LocalDateTime startDate;
LocalDateTime startDate,
@Schema(description = "종료 일시")
private LocalDateTime endDate;
LocalDateTime endDate
) {
@JsonIgnore
@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 java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "ListCallHistDto")
public class ListCallHistDto {
public record ListCallHistDto(
@Schema(description = "listCallHistIdx")
private Long listCallHistIdx;
Long listCallHistIdx,
@Schema(description = "prjctIdx")
private Long prjctIdx;
Long prjctIdx,
@Schema(description = "sid")
private String sid;
String sid,
@Schema(description = "listHderId")
private Integer listHderId;
Integer listHderId,
@Schema(description = "destNum")
private String destNum;
String destNum,
@Schema(description = "agentNum")
private String agentNum;
String agentNum,
@Schema(description = "aniNum")
private String aniNum;
String aniNum,
@Schema(description = "agentSessionId")
private String agentSessionId;
String agentSessionId,
@Schema(description = "destSessionId")
private String destSessionId;
String destSessionId,
@Schema(description = "callTy")
private String callTy;
String callTy,
@Schema(description = "callStatus")
private CallStatus callStatus;
CallStatus callStatus,
@Schema(description = "startDt")
private LocalDateTime startDt;
LocalDateTime startDt,
@Schema(description = "endDt")
private LocalDateTime endDt;
LocalDateTime endDt,
@Schema(description = "totalTime")
private Integer totalTime;
Integer totalTime,
@Schema(description = "talkTime")
private Integer talkTime;
Integer talkTime,
@Schema(description = "mediaServerId")
private Integer mediaServerId;
Integer mediaServerId,
@Schema(description = "mediaServerName")
private String mediaServerName;
String mediaServerName,
@Schema(description = "recordFileName")
private String recordFileName;
String recordFileName,
@Schema(description = "regUser")
private String regUser;
String regUser,
@Schema(description = "regDt")
private LocalDateTime regDt;
LocalDateTime regDt
) {
public static ListCallHistDto from(TListCallHistEntity entity) {
return ListCallHistDto.builder()

View File

@@ -9,37 +9,32 @@ import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "리스트 + 컨택이력 다운로드 요청 DTO")
public class ListEventHistDownloadRequestDto {
public record ListEventHistDownloadRequestDto(
@Valid
@NotNull
@Schema(description = "리스트 필터")
private ListFilterDto listFilter;
ListFilterDto listFilter,
@NotEmpty
@Schema(description = "조회할 ResultCodeType 목록")
private List<ResultCodeType> resultCodeTypes;
List<ResultCodeType> resultCodeTypes,
@NotNull
@Schema(description = "조회 기준")
private ListEventHistoryBase searchBase;
ListEventHistoryBase searchBase,
@Schema(description = "이력 정렬 순서. ASC=오래된 이력 우선, DESC=최근 이력 우선", defaultValue = "ASC")
private ListEventHistoryOrder historyOrder = ListEventHistoryOrder.ASC;
ListEventHistoryOrder historyOrder,
@Valid
@Schema(description = "조회 기간")
private DateRangeDto dateRange;
DateRangeDto dateRange
) {
public ListEventHistoryOrder getHistoryOrder() {
public ListEventHistoryOrder 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 jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "설문 결과 입력 DTO")
public class ListEventHistFromSurveyDto {
public record ListEventHistFromSurveyDto(
@NotNull
@Schema(description = "설문 action 코드")
private ListEventHistorySurveyType action;
ListEventHistorySurveyType action,
@NotNull
@Schema(description = "프로젝트 설문 고유번호")
private Long prjctSurveyIdx;
Long prjctSurveyIdx,
@NotNull
@Schema(description = "리스트 고유번호")
private String sid;
String sid,
@NotNull
@Valid
@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 jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "내부 리스트 이벤트 이력 추가 요청 DTO")
public class ListEventHistInsertRequestDto {
public record ListEventHistInsertRequestDto(
@NotNull
@Schema(description = "프로젝트 고유 번호")
private Long prjctIdx;
Long prjctIdx,
@NotNull
@Schema(description = "리스트 고유 번호")
private String sid;
String sid,
@NotNull
@Schema(description = "결과 코드 타입")
private ResultCodeType resultCodeType;
ResultCodeType resultCodeType,
@NotNull
@Schema(description = "결과 코드")
private Integer resultCd;
Integer resultCd,
@Schema(description = "전화 이력 id")
private Long listCallHistIdx;
Long listCallHistIdx,
@Valid
@Schema(description = "메타 데이터")
private ListEventHistInternalMetaDto meta;
ListEventHistInternalMetaDto meta,
@NotNull
@Schema(description = "사용자 메모")
private String memo;
String memo
) {
}

View File

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

View File

@@ -4,35 +4,44 @@ import com.kri.contact.server.persistence.entity.TListEventHistEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "ListEventHistoryDto")
public class ListEventHistoryDto {
public record ListEventHistoryDto(
@Schema(description = "listEventHistIdx")
private Long listEventHistIdx;
Long listEventHistIdx,
@Schema(description = "eventTy")
private Short eventTy;
Short eventTy,
@Schema(description = "prjctIdx")
private Long prjctIdx;
Long prjctIdx,
@Schema(description = "prjctSurveyIdx")
private Long prjctSurveyIdx;
Long prjctSurveyIdx,
@Schema(description = "sid")
private String sid;
String sid,
@Schema(description = "resultCd")
private Integer resultCd;
Integer resultCd,
@Schema(description = "metaData")
private String metaData;
String metaData,
@Schema(description = "listCallHistIdx")
private Long listCallHistIdx;
Long listCallHistIdx,
@Schema(description = "memo")
private String memo;
String memo,
@Schema(description = "regUser")
private String regUser;
String regUser,
@Schema(description = "regDt")
private LocalDateTime regDt;
LocalDateTime regDt
) {
public static ListEventHistoryDto from(TListEventHistEntity entity) {
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 java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "외부에서 리스트 조회")
public class ListSearchExternalDto {
public record ListSearchExternalDto(
@Schema(description = "프로젝트 코드")
private String prjctCd;
String prjctCd,
@Schema(description = "SID")
private String sid;
String sid,
@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 jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "리스트 검색 조건")
public class ListSearchRequestDto {
public record ListSearchRequestDto(
@Valid
@NotNull
@Schema(description = "리스트 필터")
private ListFilterDto listFilter;
ListFilterDto listFilter,
@NotNull
@Schema(description = "페이지네이션 정보")
private PageRequestDto pageRequest;
PageRequestDto pageRequest
) {
public static ListSearchRequestDto of(ListFilterDto listFilter, PageRequestDto pageRequest){
return ListSearchRequestDto.builder()

View File

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

View File

@@ -4,21 +4,16 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.Set;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "설문별 결과 필터 조건")
public class ListSurveyResultFilterConditionDto {
public record ListSurveyResultFilterConditionDto(
@NotNull
@Schema(description = "프로젝트 설문 고유번호")
private Long prjctSurveyIdx;
Long prjctSurveyIdx,
@NotEmpty
@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 jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "설문 결과 수정 내용")
public class ListSurveyResultUpdateDto {
public record ListSurveyResultUpdateDto(
@NotNull
@Schema(description = "프로젝트 설문 고유번호")
private Long prjctSurveyIdx;
Long prjctSurveyIdx,
@NotNull
@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 java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "ListUpdateHistoryDto")
public class ListUpdateHistoryDto {
public record ListUpdateHistoryDto(
@Schema(description = "listUpdateHistIdx")
private Long listUpdateHistIdx;
Long listUpdateHistIdx,
@Schema(description = "prjctIdx")
private Long prjctIdx;
Long prjctIdx,
@Schema(description = "sid")
private String sid;
String sid,
@Schema(description = "listHderId")
private Integer listHderId;
Integer listHderId,
@Schema(description = "beforeVal")
private String beforeVal;
String beforeVal,
@Schema(description = "afterVal")
private String afterVal;
String afterVal,
@Schema(description = "regUser")
private String regUser;
String regUser,
@Schema(description = "regDt")
private LocalDateTime regDt;
LocalDateTime regDt
) {
public static ListUpdateHistoryDto from(TListUpdateHistEntity entity) {
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 lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "리스트 업로드 파일 정보")
public class ListUploadFileInfoDto {
public record ListUploadFileInfoDto(
@Schema(description = "파일명")
private String fileName;
String fileName,
@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 java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "리스트 업로드 이력")
public class ListUploadHistoryDto {
public record ListUploadHistoryDto(
@Schema(description = "리스트 업로드 로그 ID")
private String listUploadLogId;
String listUploadLogId,
@Schema(description = "업로드 차수")
private Integer wave;
Integer wave,
@Schema(description = "업로드 파일명")
private String fileName;
String fileName,
@Schema(description = "업로드 리스트 수")
private Integer listCount;
Integer listCount,
@Schema(description = "업로드 모드")
private ListUploadMode uploadMode;
ListUploadMode uploadMode,
@Schema(description = "등록 사용자")
private String regUser;
String regUser,
@Schema(description = "등록 일시")
private LocalDateTime regDt;
LocalDateTime regDt,
@Schema(description = "업로드 파일 자동삭제 일시")
private LocalDateTime schedulingDelDt;
LocalDateTime schedulingDelDt
) {
public static ListUploadHistoryDto fromEntity(TListUploadLogEntity entity) {
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 jakarta.validation.constraints.NotNull;
import java.util.Map;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "리스트 업로드 요청 DTO")
public class ListUploadRequestDto {
public record ListUploadRequestDto(
@NotNull
@Schema(description = "업로드 모드")
private ListUploadMode uploadMode;
ListUploadMode uploadMode,
@Schema(description = "이메일 중복 체크")
private boolean checkDuplicateEmail;
boolean checkDuplicateEmail,
@Schema(description = "전화번호 중복 체크")
private boolean checkDuplicatePhone;
boolean checkDuplicatePhone,
@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 lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "MessageFailedChunkDto")
public class MessageFailedChunkDto {
public record MessageFailedChunkDto(
@Schema(description = "chunkIndex")
private int chunkIndex;
int chunkIndex,
@Schema(description = "from")
private int from;
int from,
@Schema(description = "to")
private int to;
int to,
@Schema(description = "targetCount")
private int targetCount;
int targetCount,
@Schema(description = "errorMessage")
private String errorMessage;
String errorMessage
) {
}

View File

@@ -1,6 +1,8 @@
package com.kri.contact.server.dto.message;
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 io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
@@ -8,39 +10,35 @@ import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "Message bulk send request")
public class MessageSendBulkRequestDto {
public record MessageSendBulkRequestDto(
@NotNull
@Schema(description = "템플릿 고유 번호", requiredMode = Schema.RequiredMode.REQUIRED)
private Long tmplatIdx;
Long tmplatIdx,
@NotNull
@Schema(description = "예약 발송 여부", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean resve;
Boolean resve,
@Schema(description = "예약 발송 일시")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime sendDt;
LocalDateTime sendDt,
@Valid
@Schema(description = "리스트 필터")
private ListFilterDto listFilter;
ListFilterDto listFilter,
@NotEmpty
@Schema(description = "수신처로 사용할 리스트 헤더 ID 목록", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Integer> destHeaderIds;
List<Integer> destHeaderIds,
@Schema(description = "수신자 이름으로 사용할 리스트 헤더 ID")
private Integer destNameHeaderId;
Integer destNameHeaderId,
@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.List;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "MessageBulkSendResponseDto")
public class MessageSendBulkResponseDto {
public record MessageSendBulkResponseDto(
@Schema(description = "bulkSendKey")
private String bulkSendKey;
String bulkSendKey,
@Schema(description = "targetCount")
private int targetCount;
int targetCount,
@Schema(description = "requestCount")
private int requestCount;
int requestCount,
@Schema(description = "acceptCount")
private int acceptCount;
int acceptCount,
@Schema(description = "failCount")
private int failCount;
@Builder.Default
int failCount,
@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 java.time.LocalDateTime;
import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "Message single send request")
public class MessageSendSingleRequestDto {
public record MessageSendSingleRequestDto(
@NotNull
@Schema(description = "tmplatIdx")
private Long tmplatIdx;
Long tmplatIdx,
@NotNull
@Schema(description = "resve")
private Boolean resve;
Boolean resve,
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "sendDt")
private LocalDateTime sendDt;
LocalDateTime sendDt,
@NotNull
@Schema(description = "sid")
private String sid;
String sid,
@NotEmpty
@Schema(description = "destHeaderIds")
private List<Integer> destHeaderIds;
List<Integer> destHeaderIds,
@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 java.util.Map;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "Message single send response")
public class MessageSendSingleResponseDto {
public record MessageSendSingleResponseDto(
@Schema(description = "cmid")
private String cmid;
String cmid,
@Schema(description = "data")
private Map<String, Object> data;
Map<String, Object> data
) {
public static MessageSendSingleResponseDto from(NotiHubSendSingleResponseDto response) {
return MessageSendSingleResponseDto.builder()
.cmid(response.getCmid())
.data(response.getData())
.cmid(response.cmid())
.data(response.data())
.build();
}
}

View File

@@ -1,23 +1,20 @@
package com.kri.contact.server.dto.progress;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "진행 현황 조회 요청")
public class ProgressSearchRequestDto {
public record ProgressSearchRequestDto(
@Schema(description = "사용자 ID")
private String userId;
String userId,
@Schema(description = "회사 ID")
private String cmpnId;
String cmpnId,
@Schema(description = "시작일시")
private String startDt;
String startDt,
@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 jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "프로젝트 생성 요청")
public class ProjectCreateRequestDto {
public record ProjectCreateRequestDto(
@Size(max = 128)
@NotBlank
@Schema(description = "프로젝트 명")
private String prjctName;
String prjctName,
@Size(max = 32)
@NotBlank
@Schema(description = "인트라넷 프로젝트 코드")
private String itrntPrjctCd;
String itrntPrjctCd,
@Size(max = 32)
@NotBlank
@Schema(description = "담당 그룹")
private String ownerDept;
String ownerDept,
@Size(max = 32)
@NotBlank
@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 io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "프로젝트 생성 요청")
public class ProjectMainTemplateUpdateRequestDto {
public record ProjectMainTemplateUpdateRequestDto(
@NotNull
@Schema(description = "프로젝트 명")
private Long prjctIdx;
Long prjctIdx,
@NotNull
@Schema(description = "템플릿 채널 타입")
private ChannelType chnnlTy;
ChannelType chnnlTy,
@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 java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "프로젝트 담당들 정보")
public class ProjectOwnerResponseDto {
public record ProjectOwnerResponseDto(
@Schema(description = "담당 연구 부서")
List<String> ownerDeptList;
List<String> ownerDeptList,
@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 io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "프로젝트 검색 조건")
public class ProjectSearchRequestDto {
public record ProjectSearchRequestDto(
@Schema(description = "검색 텍스트")
private String prjctText; // like 대상
String prjctText, // like 대상
@Schema(description = "프로젝트 상태 리스트")
private List<Short> prjctStatusList; // in (0,1,10)
List<Short> prjctStatusList, // in (0,1,10)
@Schema(description = "담당 부서 리스트")
private List<String> ownerDeptList; // in ('S101','P101')
List<String> ownerDeptList, // in ('S101','P101')
@Schema(description = "담당 실사 리스트")
private List<String> ownerFwList; // in ('jspark','jhchae')
List<String> ownerFwList, // in ('jspark','jhchae')
@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 jakarta.validation.constraints.NotNull;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "프로젝트 수정 요청")
public class ProjectUpdateRequestDto {
public record ProjectUpdateRequestDto(
@NotNull
@Schema(description = "프로젝트 정보")
private ProjectInfoDto projectInfo;
ProjectInfoDto projectInfo,
@Schema(description = "프로젝트 수정 대상 결과 코드")
private List<ResultCodeDto> resultCodeList;
List<ResultCodeDto> resultCodeList,
@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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
@Schema(description = "결과 코드")
public class ResultCodeDto {
public record ResultCodeDto(
@Schema(description = "결과 코드 고유 키")
private String resultCdUUID;
String resultCdUUID,
@Schema(description = "프로젝트 인덱스")
private Long prjctIdx;
Long prjctIdx,
@Schema(description = "결과 코드 타입")
private ResultCodeType resultCdTy;
ResultCodeType resultCdTy,
@Schema(description = "결과 코드")
private Short resultCd;
Short resultCd,
@Schema(description = "결과 코드 라벨")
private String resultCdLbl;
String resultCdLbl,
@Schema(description = "isDefault")
private Boolean isDefault;
Boolean isDefault
) {
public static ResultCodeDto from(TResultCodeEntity entity) {
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 java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "ListReserveDto")
public class ListReserveDto {
public record ListReserveDto(
@Schema(description = "listResveIdx")
private Long listResveIdx;
Long listResveIdx,
@Schema(description = "prjctIdx")
private Long prjctIdx;
Long prjctIdx,
@Schema(description = "프로젝트명")
private String prjctName;
String prjctName,
@Schema(description = "sid")
private String sid;
String sid,
@Schema(description = "memo")
private String memo;
String memo,
@Schema(description = "cnfirm")
private Boolean cnfirm;
Boolean cnfirm,
@Schema(description = "resveDt")
private LocalDateTime resveDt;
LocalDateTime resveDt,
@Schema(description = "resveUser")
private String resveUser;
String resveUser,
@Schema(description = "regUser")
private String regUser;
String regUser,
@Schema(description = "regDt")
private LocalDateTime regDt;
LocalDateTime regDt
) {
public static ListReserveDto from(TListResveEntity entity) {
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.NotNull;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "ListReserveRequestDto")
public class ListReserveRequestDto {
public record ListReserveRequestDto(
@NotNull
@Schema(description = "prjctIdx")
private Long prjctIdx;
Long prjctIdx,
@NotNull
@Schema(description = "sid")
private String sid;
String sid,
@NotBlank
@Schema(description = "userId")
private String userId;
String userId,
@NotNull
@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 lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "UploadContentDto")
public class UploadContentDto {
String fileName;
String fileType;
Long fileSize;
public record UploadContentDto(
String fileName,
String fileType,
Long fileSize
) {
public static UploadContentDto from(MultipartFile file){
return UploadContentDto.builder()
@@ -28,4 +24,3 @@ public class UploadContentDto {
.build();
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -131,9 +131,9 @@ public class ListSearchService {
) {
List<TListEntity> listEntities = findPagedListEntities(prjctIdx, request);
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 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) {
List<Integer> exactMatchHeaderIds = listHeaderService.getExactMatchHeaderId(prjctIdx);
ListFilterDto listFilter = request == null ? null : request.getListFilter();
ListFilterDto listFilter = request == null ? null : request.listFilter();
return listRepository.findPagedListEntities(
prjctIdx,
exactMatchHeaderIds,
listFilter,
request == null ? null : request.getPageRequest()
request == null ? null : request.pageRequest()
);
}
@@ -693,11 +693,11 @@ public class ListSearchService {
}
private LocalDateTime getStartDate(DateRangeDto dateRange) {
return dateRange == null ? null : dateRange.getStartDate();
return dateRange == null ? null : dateRange.startDate();
}
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) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -31,19 +31,19 @@ public class ReserveService {
@Transactional
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", "예약 대상 리스트를 찾을 수 없습니다.")
.with("prjctIdx", request.getPrjctIdx())
.with("sid", request.getSid());
.with("prjctIdx", request.prjctIdx())
.with("sid", request.sid());
}
TListResveEntity entity = new TListResveEntity();
entity.setPrjctIdx(request.getPrjctIdx());
entity.setSid(request.getSid());
entity.setPrjctIdx(request.prjctIdx());
entity.setSid(request.sid());
entity.setMemo("");
entity.setCnfirm(false);
entity.setResveDt(request.getResveDt());
entity.setResveUser(request.getUserId().trim());
entity.setResveDt(request.resveDt());
entity.setResveUser(request.userId().trim());
entity.setRegUser(regUser == null || regUser.isBlank() ? ContactConstant.SYSTEM_USER_NAME : regUser);
entity.setRegDt(regDt);
TListResveEntity saved = listReserveRepository.save(entity);

View File

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

View File

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

View File

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

View File

@@ -87,7 +87,7 @@ public class ListAsyncMaintenanceService {
public ListAsyncJobAcceptedDto upload(Long projectId, MultipartFile file, ListUploadRequestDto request,
RequestUserContext user) {
access.requireProject(projectId, user);
if (request == null || request.getUploadMode() == null) {
if (request == null || request.uploadMode() == null) {
throw BusinessException.badRequest("ASYNC_UPLOAD_MODE_REQUIRED", "업로드 모드가 필요합니다.");
}
var saved = mapper.convertValue(request, ListUploadRequestDto.class);
@@ -103,7 +103,7 @@ public class ListAsyncMaintenanceService {
job.setListUploadLogId(uploads.createPendingLog(projectId, source, saved, user.getUserId(),
job.getRegDt()).getListUploadLogId());
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()));
initialized.set(true);
});
@@ -139,7 +139,7 @@ public class ListAsyncMaintenanceService {
}
context.progress("PROCESSING", (long) prepared.sids().size(), Map.of("validationRowCnt", prepared.totalCount()));
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;
var attempted = new AtomicInteger();
var failed = new AtomicInteger();

View File

@@ -36,14 +36,14 @@ public class ListAsyncMessageService {
public ListAsyncJobAcceptedDto submit(Long projectId, ChannelType channel, MessageSendBulkRequestDto request,
RequestUserContext user) {
access.requireProject(projectId, user);
if (channel == null || request == null || request.getTmplatIdx() == null || request.getResve() == null
|| request.getDestHeaderIds() == null || request.getDestHeaderIds().isEmpty()
|| request.getDestHeaderIds().stream().anyMatch(Objects::isNull)
|| Boolean.TRUE.equals(request.getResve()) && request.getSendDt() == null) {
if (channel == null || request == null || request.tmplatIdx() == null || request.resve() == null
|| request.destHeaderIds() == null || request.destHeaderIds().isEmpty()
|| request.destHeaderIds().stream().anyMatch(Objects::isNull)
|| Boolean.TRUE.equals(request.resve()) && request.sendDt() == null) {
throw BusinessException.badRequest("INVALID_MESSAGE_REQUEST", "템플릿·수신처·예약 조건을 확인해 주세요.");
}
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; };
Map<String,Object> snapshot = mapper.convertValue(saved, new TypeReference<>() {});
return new ListAsyncJobAcceptedDto(executor.submit(projectId, user.getUserId(), type, snapshot, null,
@@ -54,7 +54,7 @@ public class ListAsyncMessageService {
RequestUserContext user, ListAsyncJobExecutor.JobContext context) {
access.requireProject(projectId, user);
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()));
var messageContext = messages.prepareAsync(projectId, request);
var failures = new ArrayList<Map<String,Object>>();
@@ -94,12 +94,12 @@ public class ListAsyncMessageService {
failedSids.add(row.sid());
}
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())));
failedSids.add(row.sid());
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);
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) {
if (value == null || value.getRequestCount() == null || value.getAcceptCount() == null || value.getFailCount() == null
|| value.getRequestCount() != batch.size() || value.getAcceptCount() < 0 || value.getFailCount() < 0
|| (long) value.getAcceptCount() + value.getFailCount() > batch.size()
|| value.getBulkSendKey() != null && !key.equals(value.getBulkSendKey())) {
if (value == null || value.requestCount() == null || value.acceptCount() == null || value.failCount() == null
|| value.requestCount() != batch.size() || value.acceptCount() < 0 || value.failCount() < 0
|| (long) value.acceptCount() + value.failCount() > batch.size()
|| value.bulkSendKey() != null && !key.equals(value.bulkSendKey())) {
return outcome(batch, key, "INVALID_RESPONSE", 0, 0, batch.size(), true, true);
}
int unknown = batch.size() - value.getAcceptCount() - value.getFailCount();
return outcome(batch, key, unknown > 0 ? "UNKNOWN" : value.getFailCount() > 0 ? value.getAcceptCount() > 0 ? "PARTIAL" : "REJECTED" : "ACCEPTED",
value.getAcceptCount(), value.getFailCount(), unknown, true, true);
int unknown = batch.size() - value.acceptCount() - value.failCount();
return outcome(batch, key, unknown > 0 ? "UNKNOWN" : value.failCount() > 0 ? value.acceptCount() > 0 ? "PARTIAL" : "REJECTED" : "ACCEPTED",
value.acceptCount(), value.failCount(), unknown, true, true);
}
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>();
values.put("bulkSendKey", key);
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("acceptedRecipientCnt", accepted);
values.put("failedRecipientCnt", failed);

View File

@@ -102,7 +102,7 @@ public class SystemEventLogService {
public void writeUpdateDefaultMessageTemplate(String regId, LocalDateTime regDt, String clientIp,
ProjectMainTemplateUpdateRequestDto req) {
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,

View File

@@ -20,7 +20,7 @@ public class ListAsyncMessageSpool {
public record Destination(String sid, String destEml, String destTel, String destNm, Map<String,String> msgParam) {
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() {
return NotiHubDestInfoDto.builder().sid(sid).destEml(destEml).destTel(destTel).destNm(destNm).msgParam(msgParam).build();