develop #38

Merged
gitadmin merged 12 commits from develop into master 2026-10-26 08:33:11 +09:00
146 changed files with 4400 additions and 1366 deletions

View File

@@ -2,7 +2,7 @@
### Product Purpose and Current Phase ### Product Purpose and Current Phase
- This is the launched Java 17 and Spring Boot backend for KRI contact operations. Preserve first-release API and data behavior while delivering approved follow-up features. - This is the pre-launch Java 17 and Spring Boot backend for KRI contact operations. Preserve established API and data behavior except where the user explicitly approves a contract change.
- The domain includes projects, contact lists and headers/items, uploads and downloads, assignments, call sessions, call/event/update histories, progress, scenarios and images, result codes, users, companies, roles, message templates, reservations, SMS, and email workflows. - The domain includes projects, contact lists and headers/items, uploads and downloads, assignments, call sessions, call/event/update histories, progress, scenarios and images, result codes, users, companies, roles, message templates, reservations, SMS, and email workflows.
- Prefer domain correctness, operational safety, and backward-compatible evolution over broad refactoring. - Prefer domain correctness, operational safety, and backward-compatible evolution over broad refactoring.
@@ -17,7 +17,7 @@
### Shared Library and Integrations ### Shared Library and Integrations
- Consume `com.kri.common:starter:beta.1.6.8`. Do not change this approved version or duplicate an available KriCommon feature without separate explicit approval. - Consume `com.kri.common:starter:beta.1.7.0`. Do not change this approved version or duplicate an available KriCommon feature without separate explicit approval.
- Import public KriCommon APIs from `com.kri.common.feature.*` and keep application code out of KriCommon runtime internals. - Import public KriCommon APIs from `com.kri.common.feature.*` and keep application code out of KriCommon runtime internals.
- Treat IntranetExtension, NotiHub, ShortUrl, CTI, file storage, and other external dependencies as explicit boundaries with validated inputs, timeouts, error mapping, retry/idempotency decisions, and safe rollback behavior. - Treat IntranetExtension, NotiHub, ShortUrl, CTI, file storage, and other external dependencies as explicit boundaries with validated inputs, timeouts, error mapping, retry/idempotency decisions, and safe rollback behavior.
- Never log API keys, credentials, full message bodies, telephone numbers in bulk, uploaded list contents, or unrestricted personal information. - Never log API keys, credentials, full message bodies, telephone numbers in bulk, uploaded list contents, or unrestricted personal information.

View File

@@ -38,7 +38,7 @@ repositories {
} }
dependencies { dependencies {
implementation "com.kri.common:starter:beta.1.6.9" implementation "com.kri.common:starter:beta.1.7.0"
implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-security'

View File

@@ -22,8 +22,6 @@ public final class ContactConstant {
public static final int RESEARCHER_USER_ROLE = 2000; public static final int RESEARCHER_USER_ROLE = 2000;
public static final int OUTSOURCE_USER_ROLE = 4000; public static final int OUTSOURCE_USER_ROLE = 4000;
public static final int FIELDWORK_USER_ROLE = 9000; public static final int FIELDWORK_USER_ROLE = 9000;
public static final int CONTACT_INTERVIEWER_ROLE = 9002;
public static final int FIELD_INTERVIEWER_ROLE = 9003;
public static final StreamingReadOptions UPPER_CASE_HEADER_OPTIONS = public static final StreamingReadOptions UPPER_CASE_HEADER_OPTIONS =
new StreamingReadOptions(null, 0, 1, header -> header == null ? null : header.toUpperCase( new StreamingReadOptions(null, 0, 1, header -> header == null ? null : header.toUpperCase(
Locale.ROOT)); Locale.ROOT));
@@ -36,11 +34,6 @@ public final class ContactConstant {
Stream.of(ListHeaderType.FILE) Stream.of(ListHeaderType.FILE)
).toList(); ).toList();
public static final List<ListHeaderType> ASSIGN_TYPE = List.of(
ListHeaderType.OUTSOURCE,
ListHeaderType.CONTACT_INTERVIEWER,
ListHeaderType.FIELD_INTERVIEWER
);
public static final List<ListHeaderType> EXACT_MATCH_HEADER_TYPE = List.of( public static final List<ListHeaderType> EXACT_MATCH_HEADER_TYPE = List.of(
ListHeaderType.CONTENT_ITEM ListHeaderType.CONTENT_ITEM

View File

@@ -0,0 +1,18 @@
package com.kri.contact.server.common.enums;
import java.util.Map;
public enum ListAsyncAssignOperation {
ASSIGN, RESET;
public static ListAsyncAssignOperation fromRequest(ListAsyncJobType type, Map<String, Object> request) {
if (type != ListAsyncJobType.LIST_ASSIGN || request == null || request.get("operation") == null) {
return null;
}
return valueOf(request.get("operation").toString());
}
public String displayName() {
return this == RESET ? "배정 초기화" : "리스트 배정";
}
}

View File

@@ -0,0 +1,13 @@
package com.kri.contact.server.common.enums;
import java.util.List;
public enum ListAsyncJobStatus {
QUEUED, RUNNING, CANCEL_REQUESTED, CANCELLED, SUCCEEDED, FAILED, PARTIALLY_SUCCEEDED;
public static final List<ListAsyncJobStatus> ACTIVE = List.of(QUEUED, RUNNING, CANCEL_REQUESTED);
public boolean isTerminal() {
return this == CANCELLED || this == SUCCEEDED || this == FAILED || this == PARTIALLY_SUCCEEDED;
}
}

View File

@@ -0,0 +1,32 @@
package com.kri.contact.server.common.enums;
public enum ListAsyncJobType {
LIST_UPLOAD, LIST_RESET, LIST_UPDATE, LIST_ASSIGN,
LIST_DOWNLOAD, CONTACT_HISTORY_DOWNLOAD, UPDATE_HISTORY_DOWNLOAD, ITEM_ZIP_DOWNLOAD,
EMAIL_BULK, SMS_BULK, KKO_BULK;
public boolean isImportant() {
return this == LIST_UPLOAD || this == LIST_RESET || this == LIST_UPDATE
|| this == LIST_ASSIGN;
}
public boolean conflictsWith(ListAsyncJobType existing, boolean sameUser) {
return isImportant() || existing.isImportant() || (sameUser && this == existing);
}
public String displayName() {
return switch (this) {
case LIST_UPLOAD -> "리스트 업로드";
case LIST_RESET -> "리스트 초기화";
case LIST_UPDATE -> "리스트 일괄 수정";
case LIST_ASSIGN -> "배정 작업";
case LIST_DOWNLOAD -> "리스트 다운로드";
case CONTACT_HISTORY_DOWNLOAD -> "컨택 이력 다운로드";
case UPDATE_HISTORY_DOWNLOAD -> "리스트 수정 이력 다운로드";
case ITEM_ZIP_DOWNLOAD -> "첨부파일 ZIP 다운로드";
case EMAIL_BULK -> "이메일 일괄 발송";
case SMS_BULK -> "문자 일괄 발송";
case KKO_BULK -> "알림톡 일괄 발송";
};
}
}

View File

@@ -117,7 +117,7 @@ public class ContactSurveyApiClient {
} }
} }
throw new IllegalStateException("Unsupported contact survey target profile"); throw BusinessException.internalError("UNSUPPORTED_CONTACT_SURVEY_PROFILE", "Unsupported contact survey target profile");
} }
private Map<String, String> headers() { private Map<String, String> headers() {

View File

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

View File

@@ -31,6 +31,8 @@ import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateBasicDt
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDetailDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDetailDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateSummaryDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateSummaryDto;
import com.kri.contact.server.dto.message.MessageSendCancelBulkRequestDto;
import com.kri.contact.server.dto.message.MessageSendCancelSingleRequestDto;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
@@ -74,6 +76,22 @@ public class NotiHubApiClient {
@Value("${kri.auth.apikey.key}") @Value("${kri.auth.apikey.key}")
private String apiKey; private String apiKey;
public ResponseEntity<byte[]> cancelSingle(
MessageSendCancelSingleRequestDto body,
HttpServletRequest request,
RequestUserContext ctx
) {
return forward(request, toJsonBytes(body), request.getContentType(), ctx);
}
public ResponseEntity<byte[]> cancelBulk(
MessageSendCancelBulkRequestDto body,
HttpServletRequest request,
RequestUserContext ctx
) {
return forward(request, toJsonBytes(body), request.getContentType(), ctx);
}
public NotiHubTemplateDto getTemplate(Long tmplatIdx) { public NotiHubTemplateDto getTemplate(Long tmplatIdx) {
String url = notiHubBaseUrl + "/template/" + tmplatIdx; String url = notiHubBaseUrl + "/template/" + tmplatIdx;
try { try {
@@ -498,7 +516,8 @@ public class NotiHubApiClient {
} }
private String toNotiHubPath(String path) { private String toNotiHubPath(String path) {
String notiHubPath = replacePathPrefix(path, "/message-template", "/template"); String notiHubPath = replacePathPrefix(path, "/message-send/cancel", "/send/cancel");
notiHubPath = replacePathPrefix(notiHubPath, "/message-template", "/template");
notiHubPath = replacePathPrefix(notiHubPath, "/message-report", "/report"); notiHubPath = replacePathPrefix(notiHubPath, "/message-report", "/report");
return replacePathPrefix(notiHubPath, "/report/bulk-detail-excel", "/report/bulk-detail/excel"); return replacePathPrefix(notiHubPath, "/report/bulk-detail-excel", "/report/bulk-detail/excel");
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,25 @@
package com.kri.contact.server.config;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;
@Getter
@Setter
@Validated
@ConfigurationProperties(prefix = "kri.list-async")
public class ListAsyncProperties {
@Min(1)
private int threads = 2;
@Min(1)
private int queueCapacity = 10;
@NotBlank
@Size(max = 64)
private String ownerInstance = "contact-server";
@NotBlank
private String resultBaseDir = "upload-file/list-async-results";
}

View File

@@ -4,8 +4,6 @@ import com.kri.common.feature.datetime.DateTimeUtil;
import com.kri.common.feature.web.RequestUserContext; import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.dto.assign.ProjectCompanyAssignSummaryDto; import com.kri.contact.server.dto.assign.ProjectCompanyAssignSummaryDto;
import com.kri.contact.server.dto.assign.ProjectFieldworkAssignSummaryDto; import com.kri.contact.server.dto.assign.ProjectFieldworkAssignSummaryDto;
import com.kri.contact.server.dto.list.ListAssignRequestDto;
import com.kri.contact.server.dto.list.ListAssignResetRequestDto;
import com.kri.contact.server.service.AssignService; import com.kri.contact.server.service.AssignService;
import com.kri.contact.server.service.common.SystemEventLogService; import com.kri.contact.server.service.common.SystemEventLogService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@@ -14,7 +12,6 @@ import jakarta.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@@ -95,33 +92,4 @@ public class AssignController {
systemEventLogService.writeAssignCmpnProject(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, systemEventLogService.writeAssignCmpnProject(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx,
assignCmpnIdList); assignCmpnIdList);
} }
@Operation(summary = "리스트 배정")
@PutMapping("/list/{prjctIdx}/{assignId}")
public Integer upsertListAssign(
@PathVariable Long prjctIdx,
@PathVariable String assignId,
@Valid @RequestBody ListAssignRequestDto req,
RequestUserContext ctx
) {
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
Integer assignCnt = assignService.upsertListAssign(prjctIdx, assignId, req, ctx.getUserId(), now);
systemEventLogService.writeAssignList(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, req);
return assignCnt;
}
@Operation(summary = "리스트 배정 초기화")
@DeleteMapping("/list/reset/{prjctIdx}")
public Integer resetListAssign(
@PathVariable Long prjctIdx,
@Valid @RequestBody ListAssignResetRequestDto req,
RequestUserContext ctx
) {
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
Integer resetCnt = assignService.resetListAssign(prjctIdx, req);
systemEventLogService.writeAssignListReset(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, req);
return resetCnt;
}
} }

View File

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

View File

@@ -0,0 +1,55 @@
package com.kri.contact.server.controller;
import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.dto.list.ListEventHistDownloadRequestDto;
import com.kri.contact.server.dto.list.ListFilterDto;
import com.kri.contact.server.dto.list.async.ListAsyncJobAcceptedDto;
import com.kri.contact.server.service.async.ListAsyncDownloadService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/v1/list/jobs/{prjctIdx}/downloads")
@RequiredArgsConstructor
@Tag(name = "ListAsyncDownload", description = "리스트 비동기 다운로드 API")
public class ListAsyncDownloadController {
private final ListAsyncDownloadService downloads;
@Operation(summary = "리스트 Excel 생성 접수")
@PostMapping("/list")
public ListAsyncJobAcceptedDto list(@PathVariable Long prjctIdx,
@RequestParam(defaultValue = "true") boolean includeResult,
@Valid @RequestBody(required = false) ListFilterDto filter, RequestUserContext user) {
return downloads.list(prjctIdx, filter, includeResult, user);
}
@Operation(summary = "컨택 이력 Excel 생성 접수")
@PostMapping("/event-history")
public ListAsyncJobAcceptedDto eventHistory(@PathVariable Long prjctIdx,
@RequestParam(defaultValue = "true") boolean includeResult,
@Valid @RequestBody ListEventHistDownloadRequestDto request, RequestUserContext user) {
return downloads.eventHistory(prjctIdx, request, includeResult, user);
}
@Operation(summary = "수정 이력 Excel 생성 접수")
@PostMapping("/update-history")
public ListAsyncJobAcceptedDto updateHistory(@PathVariable Long prjctIdx,
@Valid @RequestBody(required = false) ListFilterDto filter, RequestUserContext user) {
return downloads.updateHistory(prjctIdx, filter, user);
}
@Operation(summary = "다중 첨부 ZIP 생성 접수")
@PostMapping("/item-files")
public ListAsyncJobAcceptedDto itemFiles(@PathVariable Long prjctIdx,
@Valid @RequestBody(required = false) ListFilterDto filter, RequestUserContext user) {
return downloads.itemFiles(prjctIdx, filter, user);
}
}

View File

@@ -0,0 +1,158 @@
package com.kri.contact.server.controller;
import com.kri.common.feature.web.BusinessException;
import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.common.enums.ListAsyncJobType;
import com.kri.contact.server.common.enums.ListAsyncAssignOperation;
import com.kri.contact.server.dto.list.async.ListAsyncAvailabilityDto;
import com.kri.contact.server.dto.list.async.ListAsyncActiveJobsDto;
import com.kri.contact.server.dto.list.async.ListAsyncJobStatusDto;
import com.kri.contact.server.dto.list.async.ListAsyncResultFileDto;
import com.kri.contact.server.dto.list.async.ListUploadResetActiveDto;
import com.kri.contact.server.dto.list.async.ListAsyncSidFailuresDto;
import com.kri.contact.server.persistence.entity.TListAsyncJobEntity;
import com.kri.contact.server.service.async.ListAsyncJobAccess;
import com.kri.contact.server.service.async.ListAsyncJobExecutor;
import com.kri.contact.server.service.async.ListAsyncJobStore;
import com.kri.contact.server.service.file.ListAsyncResultFileService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.List;
import java.util.stream.IntStream;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ContentDisposition;
import org.springframework.http.HttpHeaders;
import org.springframework.http.CacheControl;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/v1/list/jobs/{prjctIdx}")
@RequiredArgsConstructor
@Tag(name = "ListAsyncJob", description = "리스트 비동기 작업 관리 API")
public class ListAsyncJobController {
private final ListAsyncJobAccess access;
private final ListAsyncJobExecutor executor;
private final ListAsyncResultFileService files;
@GetMapping("/availability")
public ResponseEntity<ListAsyncAvailabilityDto> availability(
@PathVariable Long prjctIdx,
@RequestParam ListAsyncJobType jobType, RequestUserContext user) {
access.requireProject(prjctIdx, user);
return ResponseEntity.ok().cacheControl(CacheControl.noStore())
.body(executor.availability(prjctIdx, user.getUserId(), jobType));
}
@GetMapping("/upload-reset-active")
public ResponseEntity<ListUploadResetActiveDto> uploadResetActive(@PathVariable Long prjctIdx,
RequestUserContext user) {
var view = access.activeUploadReset(prjctIdx, user).map(job -> {
boolean mine = user.getUserId().equals(job.getRequestUser());
return new ListUploadResetActiveDto.Job(job.getJobType(), job.getJobStatus(), job.getJobStage(),
job.getTotalSidCnt(), processedSidCount(job), mine, mine ? job.getJobKey() : null);
});
return ResponseEntity.ok().cacheControl(CacheControl.noStore())
.body(new ListUploadResetActiveDto(view.isPresent(), view.orElse(null)));
}
@GetMapping("/my-active")
public ResponseEntity<ListAsyncActiveJobsDto> myActive(@PathVariable Long prjctIdx, RequestUserContext user) {
return ResponseEntity.ok().cacheControl(CacheControl.noStore())
.body(new ListAsyncActiveJobsDto(access.myActive(prjctIdx, user).stream().map(this::toStatus).toList()));
}
@GetMapping("/{jobKey}")
public ListAsyncJobStatusDto status(@PathVariable Long prjctIdx, @PathVariable String jobKey,
RequestUserContext user) {
return toStatus(access.require(prjctIdx, jobKey, user));
}
@PostMapping("/{jobKey}/cancel")
public ListAsyncJobStatusDto cancel(@PathVariable Long prjctIdx, @PathVariable String jobKey,
RequestUserContext user) {
access.require(prjctIdx, jobKey, user);
executor.cancel(jobKey, user.getUserId());
return toStatus(access.require(prjctIdx, jobKey, user));
}
@GetMapping("/{jobKey}/sid-failures")
public ListAsyncSidFailuresDto sidFailures(
@PathVariable Long prjctIdx, @PathVariable String jobKey,
@RequestParam(defaultValue = "0") int offset, @RequestParam(defaultValue = "100") int limit,
RequestUserContext user) {
var job = access.require(prjctIdx, jobKey, user);
if (offset < 0 || limit < 1 || limit > 1000) {
throw BusinessException.badRequest("INVALID_FAILURE_PAGE", "offset은 0 이상, limit은 1~1000이어야 합니다.");
}
return ListAsyncSidFailuresDto.from(job, offset, limit);
}
@GetMapping("/{jobKey}/range-failures")
public java.util.Map<String,Object> rangeFailures(@PathVariable Long prjctIdx, @PathVariable String jobKey,
@RequestParam(defaultValue = "0") int offset, @RequestParam(defaultValue = "100") int limit, RequestUserContext user) {
return failurePage(prjctIdx, jobKey, offset, limit, user, "rangeFailures");
}
@GetMapping("/{jobKey}/validation-errors")
public java.util.Map<String,Object> validationErrors(@PathVariable Long prjctIdx, @PathVariable String jobKey,
@RequestParam(defaultValue = "0") int offset, @RequestParam(defaultValue = "100") int limit, RequestUserContext user) {
return failurePage(prjctIdx, jobKey, offset, limit, user, "validationErrors");
}
private java.util.Map<String,Object> failurePage(Long prjctIdx, String jobKey, int offset, int limit, RequestUserContext user, String field) {
var job = access.require(prjctIdx, jobKey, user);
if (offset < 0 || limit < 1 || limit > 1000) throw BusinessException.badRequest("INVALID_FAILURE_PAGE", "조회 범위가 올바르지 않습니다.");
var detail = job.getErrorDetailJson();
var failures = detail != null && detail.get(field) instanceof List<?> values ? values : List.of();
int start = Math.min(offset, failures.size());
return java.util.Map.of("total", failures.size(), "offset", offset,
"items", failures.subList(start, (int) Math.min(failures.size(), (long) start + limit)));
}
@GetMapping("/{jobKey}/files/{index}")
public void download(@PathVariable Long prjctIdx, @PathVariable String jobKey,
@PathVariable int index, RequestUserContext user, HttpServletResponse response) throws IOException {
TListAsyncJobEntity job = access.require(prjctIdx, jobKey, user);
List<ListAsyncResultFileDto> results = job.getResultFilesJson();
if (results == null || index < 0 || index >= results.size() || !results.get(index).ready()) {
throw BusinessException.notFound("LIST_RESULT_FILE_NOT_FOUND", "결과 파일을 찾을 수 없습니다.");
}
ListAsyncResultFileDto result = results.get(index);
files.download(result.fileRef(), path -> {
response.setContentType("application/octet-stream");
response.setHeader(HttpHeaders.CACHE_CONTROL, "no-store");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION,
ContentDisposition.attachment().filename(result.fileName(), StandardCharsets.UTF_8).build().toString());
response.setContentLengthLong(Files.size(path));
Files.copy(path, response.getOutputStream());
response.flushBuffer();
});
}
private ListAsyncJobStatusDto toStatus(TListAsyncJobEntity job) {
var results = job.getResultFilesJson() == null
? List.<ListAsyncResultFileDto>of() : job.getResultFilesJson();
var resultViews = IntStream.range(0, results.size()).mapToObj(index -> {
var file = results.get(index);
return new ListAsyncJobStatusDto.ResultFile(index, file.type(), file.fileName(),
file.sizeBytes(), file.ready() && files.exists(file.fileRef()));
}).toList();
long failed = ListAsyncJobStore.failedSidCount(job);
long processed = processedSidCount(job);
Long remaining = job.getTotalSidCnt() == null ? null : Math.max(0L, job.getTotalSidCnt() - processed);
return new ListAsyncJobStatusDto(job.getJobKey(), job.getJobType(),
ListAsyncAssignOperation.fromRequest(job.getJobType(), job.getRequestJson()), job.getJobStatus(),
job.getJobStage(), job.getTotalSidCnt(), job.getCompletedSidCnt(), job.getCompletedChunkCnt(),
failed, processed, remaining,
job.getProgressJson(), job.getFailedChunkNo(), job.getErrorCode(), job.getErrorMessage(),
job.getCancelReason(), job.getRegDt(), job.getStartedDt(), job.getFinishedDt(), resultViews);
}
private static long processedSidCount(TListAsyncJobEntity job) {
return Math.addExact(job.getCompletedSidCnt(), ListAsyncJobStore.failedSidCount(job));
}
}

View File

@@ -0,0 +1,59 @@
package com.kri.contact.server.controller;
import com.kri.common.feature.web.BusinessException;
import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.common.enums.ListAsyncJobType;
import com.kri.contact.server.dto.list.ListResetRequestDto;
import com.kri.contact.server.dto.list.ListUploadRequestDto;
import com.kri.contact.server.dto.list.async.ListAsyncJobAcceptedDto;
import com.kri.contact.server.service.async.ListAsyncJobAccess;
import com.kri.contact.server.service.async.ListAsyncMaintenanceService;
import com.kri.contact.server.service.file.ListFileService;
import jakarta.servlet.http.HttpServletResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ContentDisposition;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@RestController
@RequestMapping("/api/v1/list/jobs/{prjctIdx}")
@RequiredArgsConstructor
@Tag(name = "ListAsyncMaintenance", description = "리스트 비동기 업로드 및 초기화 API")
public class ListAsyncMaintenanceController {
private final ListAsyncMaintenanceService maintenance;
private final ListAsyncJobAccess access;
private final ListFileService sources;
@PostMapping("/reset")
public ListAsyncJobAcceptedDto reset(@PathVariable Long prjctIdx,
@Valid @RequestBody ListResetRequestDto request, RequestUserContext user) {
return maintenance.reset(prjctIdx, request, user);
}
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ListAsyncJobAcceptedDto upload(@PathVariable Long prjctIdx, @RequestParam("file") MultipartFile file,
@Valid @RequestPart("request") ListUploadRequestDto request, RequestUserContext user) {
return maintenance.upload(prjctIdx, file, request, user);
}
@GetMapping("/{jobKey}/source-file")
public void source(@PathVariable Long prjctIdx, @PathVariable String jobKey, RequestUserContext user,
HttpServletResponse response) throws IOException {
var job = access.require(prjctIdx, jobKey, user);
if (job.getJobType() != ListAsyncJobType.LIST_UPLOAD || job.getInputFileRef() == null) {
throw BusinessException.notFound("LIST_UPLOAD_FILE_NOT_FOUND", "원본 파일을 찾을 수 없습니다.");
}
response.setContentType("application/octet-stream");
response.setHeader(HttpHeaders.CACHE_CONTROL, "no-store");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, ContentDisposition.attachment()
.filename("upload_source.xlsx", StandardCharsets.UTF_8).build().toString());
sources.copyListFile(prjctIdx, job.getInputFileRef(), response.getOutputStream());
response.flushBuffer();
}
}

View File

@@ -0,0 +1,54 @@
package com.kri.contact.server.controller;
import com.kri.common.feature.web.BusinessException;
import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.common.enums.ChannelType;
import com.kri.contact.server.dto.list.async.ListAsyncJobAcceptedDto;
import com.kri.contact.server.dto.message.MessageSendBulkRequestDto;
import com.kri.contact.server.service.async.ListAsyncJobAccess;
import com.kri.contact.server.service.async.ListAsyncMessageService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import java.util.List;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/v1/list/jobs/{prjctIdx}")
@RequiredArgsConstructor
@Tag(name = "ListAsyncMessage", description = "리스트 비동기 메시지 발송 API")
public class ListAsyncMessageController {
private final ListAsyncMessageService messages;
private final ListAsyncJobAccess access;
@PostMapping("/messages/email")
public ListAsyncJobAcceptedDto email(@PathVariable Long prjctIdx, @Valid @RequestBody MessageSendBulkRequestDto request, RequestUserContext user) {
return messages.submit(prjctIdx, ChannelType.EMAIL, request, user);
}
@PostMapping("/messages/sms")
public ListAsyncJobAcceptedDto sms(@PathVariable Long prjctIdx, @Valid @RequestBody MessageSendBulkRequestDto request, RequestUserContext user) {
return messages.submit(prjctIdx, ChannelType.SMS, request, user);
}
@PostMapping("/messages/kko")
public ListAsyncJobAcceptedDto kko(@PathVariable Long prjctIdx, @Valid @RequestBody MessageSendBulkRequestDto request, RequestUserContext user) {
return messages.submit(prjctIdx, ChannelType.KKO_AT, request, user);
}
public record ReportPage(int total, int offset, List<?> items) {}
@GetMapping("/{jobKey}/message-report/{section}")
public ReportPage report(@PathVariable Long prjctIdx, @PathVariable String jobKey, @PathVariable String section,
@RequestParam(defaultValue = "0") int offset, @RequestParam(defaultValue = "100") int limit, RequestUserContext user) {
var job = access.require(prjctIdx, jobKey, user);
String field = switch (section) {
case "batches" -> "messageBatches";
case "preparation-failures" -> "preparationFailures";
default -> throw BusinessException.badRequest("INVALID_REPORT_SECTION", "조회 항목이 올바르지 않습니다.");
};
if (offset < 0 || limit < 1 || limit > 1000) throw BusinessException.badRequest("INVALID_REPORT_PAGE", "조회 범위가 올바르지 않습니다.");
var detail = job.getErrorDetailJson() == null ? Map.<String,Object>of() : job.getErrorDetailJson();
List<?> items = detail.get(field) instanceof List<?> values ? values : List.of();
int start = Math.min(offset, items.size());
return new ReportPage(items.size(), offset, items.subList(start, (int) Math.min(items.size(), (long) start + limit)));
}
}

View File

@@ -0,0 +1,38 @@
package com.kri.contact.server.controller;
import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.dto.list.ListAssignRequestDto;
import com.kri.contact.server.dto.list.ListAssignResetRequestDto;
import com.kri.contact.server.dto.list.ListUpdateRequestDto;
import com.kri.contact.server.dto.list.async.ListAsyncJobAcceptedDto;
import com.kri.contact.server.service.async.ListAsyncMutationService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/v1/list/jobs/{prjctIdx}/mutations")
@RequiredArgsConstructor
@Tag(name = "ListAsyncMutation", description = "리스트 비동기 수정 및 배정 API")
public class ListAsyncMutationController {
private final ListAsyncMutationService mutations;
@PostMapping("/update")
public ListAsyncJobAcceptedDto update(@PathVariable Long prjctIdx,
@Valid @RequestBody ListUpdateRequestDto request, RequestUserContext user) {
return mutations.update(prjctIdx, request, user);
}
@PostMapping("/assign/{assignId}")
public ListAsyncJobAcceptedDto assign(@PathVariable Long prjctIdx, @PathVariable String assignId,
@Valid @RequestBody ListAssignRequestDto request, RequestUserContext user) {
return mutations.assign(prjctIdx, assignId, request, user);
}
@PostMapping("/assign-reset")
public ListAsyncJobAcceptedDto resetAssignments(@PathVariable Long prjctIdx,
@Valid @RequestBody ListAssignResetRequestDto request, RequestUserContext user) {
return mutations.resetAssignments(prjctIdx, request, user);
}
}

View File

@@ -7,19 +7,14 @@ import com.kri.common.feature.web.BusinessException;
import com.kri.common.feature.web.RequestUserContext; import com.kri.common.feature.web.RequestUserContext;
import com.kri.common.feature.web.page.PageResponseDto; import com.kri.common.feature.web.page.PageResponseDto;
import com.kri.contact.server.common.enums.ListSearchResponseType; import com.kri.contact.server.common.enums.ListSearchResponseType;
import com.kri.contact.server.dto.excel.ExcelUploadResultDto;
import com.kri.contact.server.dto.list.ListFilterDto;
import com.kri.contact.server.dto.list.ListResetRequestDto;
import com.kri.contact.server.dto.list.ListSearchRequestDto; import com.kri.contact.server.dto.list.ListSearchRequestDto;
import com.kri.contact.server.dto.list.ListSearchWithFullResultDto; import com.kri.contact.server.dto.list.ListSearchWithFullResultDto;
import com.kri.contact.server.dto.list.ListUpdateRequestDto; import com.kri.contact.server.dto.list.ListUpdateRequestDto;
import com.kri.contact.server.dto.list.ListUploadFileInfoDto; import com.kri.contact.server.dto.list.ListUploadFileInfoDto;
import com.kri.contact.server.dto.list.ListUploadHistoryDto; import com.kri.contact.server.dto.list.ListUploadHistoryDto;
import com.kri.contact.server.dto.list.ListUploadRequestDto;
import com.kri.contact.server.dto.project.ProjectInfoDto; import com.kri.contact.server.dto.project.ProjectInfoDto;
import com.kri.contact.server.dto.systemlog.UploadContentDto; import com.kri.contact.server.dto.systemlog.UploadContentDto;
import com.kri.contact.server.service.ListDownloadService; import com.kri.contact.server.service.ListDownloadService;
import com.kri.contact.server.service.ListResetService;
import com.kri.contact.server.service.ListSearchService; import com.kri.contact.server.service.ListSearchService;
import com.kri.contact.server.service.ListUpdateService; import com.kri.contact.server.service.ListUpdateService;
import com.kri.contact.server.service.ListUploadService; import com.kri.contact.server.service.ListUploadService;
@@ -38,7 +33,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@@ -46,7 +40,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -61,7 +54,6 @@ public class ListController {
private final ListSearchService listSearchService; private final ListSearchService listSearchService;
private final ListUploadService listUploadService; private final ListUploadService listUploadService;
private final ListUpdateService listUpdateService; private final ListUpdateService listUpdateService;
private final ListResetService listResetService;
private final SystemEventLogService systemEventLogService; private final SystemEventLogService systemEventLogService;
@Operation(summary = "리스트 정보 조회 With Sid") @Operation(summary = "리스트 정보 조회 With Sid")
@@ -109,50 +101,7 @@ public class ListController {
) { ) {
getProjectOrThrow(prjctIdx); getProjectOrThrow(prjctIdx);
ListUploadFileInfoDto uploadFile = listUploadService.downloadUploadFile(prjctIdx, listUploadLogId); ListUploadFileInfoDto uploadFile = listUploadService.downloadUploadFile(prjctIdx, listUploadLogId);
return buildExcelResponse(uploadFile.getFileName(), uploadFile.getBytes()); return buildExcelResponse(uploadFile.fileName(), uploadFile.bytes());
}
@Operation(summary = "리스트 다운로드")
@PostMapping("/excel/download/{prjctIdx}")
public ResponseEntity<byte[]> downloadList(
@PathVariable Long prjctIdx,
@RequestParam(defaultValue = "true") boolean includeResult,
@Valid @RequestBody(required = false) ListFilterDto listFilter
) {
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
byte[] bytes = listDownloadService.downloadList(
prjctIdx,
listFilter,
includeResult
);
return buildExcelResponse(projectInfoDto.getPrjctName() + " list.xlsx", bytes);
}
@Operation(summary = "리스트 수정 이력 다운로드")
@PostMapping("/excel/download/update/{prjctIdx}")
public ResponseEntity<byte[]> downloadListUpdateHistory(
@PathVariable Long prjctIdx,
@Valid @RequestBody(required = false) ListFilterDto listFilter
) {
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
byte[] bytes = listDownloadService.downloadSidWithUpdateHist(prjctIdx, listFilter);
return buildExcelResponse(projectInfoDto.getPrjctName() + " 수정 이력.xlsx", bytes);
}
@Operation(summary = "리스트 파일 업로드")
@PostMapping(value = "/excel/upload/{prjctIdx}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ExcelUploadResultDto uploadExcel(
@PathVariable Long prjctIdx,
@RequestParam("file") MultipartFile file,
@Valid @RequestPart("request") ListUploadRequestDto request,
RequestUserContext ctx
) {
getProjectOrThrow(prjctIdx);
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
ExcelUploadResultDto result = listUploadService.uploadExcel(prjctIdx, file, request, ctx.getUserId(), now);
systemEventLogService.writeUploadList(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, UploadContentDto.from(file));
return result;
} }
@Operation(summary = "리스트 수정") @Operation(summary = "리스트 수정")
@@ -189,17 +138,6 @@ public class ListController {
systemEventLogService.writeUploadListItemFiles(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, contents); systemEventLogService.writeUploadListItemFiles(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, contents);
} }
@Operation(summary = "리스트 별 업로드 파일 다운로드")
@PostMapping("/item-file/download/{prjctIdx}")
public ResponseEntity<byte[]> downloadItemFile(
@PathVariable Long prjctIdx,
@Valid @RequestBody(required = false) ListFilterDto listFilter
){
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
byte[] bytes = listDownloadService.downloadItemFile(prjctIdx, listFilter);
return buildZipResponse(projectInfoDto.getPrjctName() + " item_files.zip", bytes);
}
@Operation(summary = "리스트 단건 파일 다운로드") @Operation(summary = "리스트 단건 파일 다운로드")
@GetMapping("/item-file/download/{prjctIdx}/{sid}/{listHderId}") @GetMapping("/item-file/download/{prjctIdx}/{sid}/{listHderId}")
public ResponseEntity<byte[]> downloadOneItemFile( public ResponseEntity<byte[]> downloadOneItemFile(
@@ -209,26 +147,7 @@ public class ListController {
) { ) {
getProjectOrThrow(prjctIdx); getProjectOrThrow(prjctIdx);
ListUploadFileInfoDto file = listDownloadService.downloadItemFile(prjctIdx, sid, listHderId); ListUploadFileInfoDto file = listDownloadService.downloadItemFile(prjctIdx, sid, listHderId);
return buildFileResponse(file.getFileName(), file.getBytes()); return buildFileResponse(file.fileName(), file.bytes());
}
@Operation(summary = "리스트 초기화")
@DeleteMapping("/{prjctIdx}")
public int resetList(
@PathVariable Long prjctIdx,
@Valid @RequestBody ListResetRequestDto request,
RequestUserContext ctx
) {
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
int resetCount = listResetService.resetByFilter(
prjctIdx,
request.getListFilter(),
request.getResetMode(),
ctx.getUserId(),
now
);
systemEventLogService.writeResetList(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, request);
return resetCount;
} }
private ProjectInfoDto getProjectOrThrow(Long prjctIdx) { private ProjectInfoDto getProjectOrThrow(Long prjctIdx) {
@@ -239,16 +158,6 @@ public class ListController {
return projectInfoDto; return projectInfoDto;
} }
private ResponseEntity<byte[]> buildZipResponse(String fileName, byte[] bytes) {
String contentDisposition = "attachment; filename*=UTF-8''" +
URLEncoder.encode(fileName, StandardCharsets.UTF_8).replace("+", "%20");
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, contentDisposition)
.contentType(MediaType.parseMediaType("application/zip"))
.body(bytes);
}
private ResponseEntity<byte[]> buildFileResponse(String fileName, byte[] bytes) { private ResponseEntity<byte[]> buildFileResponse(String fileName, byte[] bytes) {
String contentDisposition = "attachment; filename*=UTF-8''" + String contentDisposition = "attachment; filename*=UTF-8''" +
URLEncoder.encode(fileName, StandardCharsets.UTF_8).replace("+", "%20"); URLEncoder.encode(fileName, StandardCharsets.UTF_8).replace("+", "%20");

View File

@@ -1,21 +1,14 @@
package com.kri.contact.server.controller; package com.kri.contact.server.controller;
import static com.kri.contact.server.common.util.ExcelResponseBuilder.buildExcelResponse;
import com.kri.common.feature.datetime.DateTimeUtil; import com.kri.common.feature.datetime.DateTimeUtil;
import com.kri.common.feature.web.BusinessException;
import com.kri.common.feature.web.RequestUserContext; import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.dto.list.ListEventHistDownloadRequestDto;
import com.kri.contact.server.dto.list.ListEventHistFromSurveyDto; import com.kri.contact.server.dto.list.ListEventHistFromSurveyDto;
import com.kri.contact.server.dto.list.ListEventHistInsertRequestDto; import com.kri.contact.server.dto.list.ListEventHistInsertRequestDto;
import com.kri.contact.server.dto.list.ListEventHistSurveyMetaDto; import com.kri.contact.server.dto.list.ListEventHistSurveyMetaDto;
import com.kri.contact.server.dto.list.ListEventHistoryDto; import com.kri.contact.server.dto.list.ListEventHistoryDto;
import com.kri.contact.server.dto.list.ListUpdateHistoryDto; import com.kri.contact.server.dto.list.ListUpdateHistoryDto;
import com.kri.contact.server.dto.project.ProjectInfoDto;
import com.kri.contact.server.service.ListDownloadService;
import com.kri.contact.server.service.ListHistoryQueryService; import com.kri.contact.server.service.ListHistoryQueryService;
import com.kri.contact.server.service.ListUpdateService; import com.kri.contact.server.service.ListUpdateService;
import com.kri.contact.server.service.ProjectService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -30,7 +23,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@@ -39,8 +31,6 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(name = "ListHistory", description = "리스트 이력 API") @Tag(name = "ListHistory", description = "리스트 이력 API")
public class ListHistoryController { public class ListHistoryController {
private final ProjectService projectService;
private final ListDownloadService listDownloadService;
private final ListHistoryQueryService listHistoryQueryService; private final ListHistoryQueryService listHistoryQueryService;
private final ListUpdateService listUpdateService; private final ListUpdateService listUpdateService;
@@ -62,34 +52,14 @@ public class ListHistoryController {
return listHistoryQueryService.findUpdateHistories(prjctIdx, sid); return listHistoryQueryService.findUpdateHistories(prjctIdx, sid);
} }
@Operation(summary = "리스트 이벤트 이력 다운로드")
@PostMapping("/excel/download/event/{prjctIdx}")
public ResponseEntity<byte[]> downloadListWithEventHistory(
@PathVariable Long prjctIdx,
@RequestParam(defaultValue = "true") boolean includeResult,
@Valid @RequestBody ListEventHistDownloadRequestDto request
) {
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
byte[] bytes = listDownloadService.downloadListWithEventHist(
prjctIdx,
request.getListFilter(),
request.getResultCodeTypes(),
request.getSearchBase(),
request.getDateRange(),
request.getHistoryOrder(),
includeResult
);
return buildExcelResponse(projectInfoDto.getPrjctName() + " 컨택 이력.xlsx", bytes);
}
@Operation(description = "설문 상태 추가") @Operation(description = "설문 상태 추가")
@PostMapping("/survey") @PostMapping("/survey")
public void putSurveyHistory( public void putSurveyHistory(
@Valid @RequestBody ListEventHistFromSurveyDto request, @Valid @RequestBody ListEventHistFromSurveyDto request,
RequestUserContext ctx RequestUserContext ctx
) { ) {
if (request.getMeta().getRemoteAddr() == null) { if (request.meta().getRemoteAddr() == null) {
request.getMeta().setRemoteAddr(ctx.getClientIp()); request.meta().setRemoteAddr(ctx.getClientIp());
} }
String regUser = resolveRegUser(request, ctx); String regUser = resolveRegUser(request, ctx);
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime(); final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
@@ -133,18 +103,10 @@ public class ListHistoryController {
if (ctx.getUserId() != null) { if (ctx.getUserId() != null) {
return ctx.getUserId(); return ctx.getUserId();
} }
ListEventHistSurveyMetaDto meta = request.getMeta(); ListEventHistSurveyMetaDto meta = request.meta();
if (meta != null && meta.getEntryType() != null) { if (meta != null && meta.getEntryType() != null) {
return meta.getEntryType().name(); return meta.getEntryType().name();
} }
return "SYSTEM"; return "SYSTEM";
} }
private ProjectInfoDto getProjectOrThrow(Long prjctIdx) {
ProjectInfoDto projectInfoDto = projectService.getProject(prjctIdx);
if (projectInfoDto == null) {
throw BusinessException.internalError("프로젝트가 없습니다.");
}
return projectInfoDto;
}
} }

View File

@@ -1,15 +1,22 @@
package com.kri.contact.server.controller; package com.kri.contact.server.controller;
import com.kri.common.feature.web.RequestUserContext; import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.dto.message.MessageSendBulkResponseDto; import com.kri.contact.server.dto.message.MessageSendCancelBulkRequestDto;
import com.kri.contact.server.dto.message.MessageSendBulkRequestDto; import com.kri.contact.server.dto.message.MessageSendCancelResponseDto;
import com.kri.contact.server.dto.message.MessageSendCancelSingleRequestDto;
import com.kri.contact.server.dto.message.MessageSendSingleRequestDto; import com.kri.contact.server.dto.message.MessageSendSingleRequestDto;
import com.kri.contact.server.dto.message.MessageSendSingleResponseDto; import com.kri.contact.server.dto.message.MessageSendSingleResponseDto;
import com.kri.contact.server.service.MessageSendService; import com.kri.contact.server.service.MessageSendService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -24,6 +31,30 @@ public class MessageSendController {
private final MessageSendService messageSendService; private final MessageSendService messageSendService;
@Operation(summary = "Cancel a scheduled message")
@ApiResponse(responseCode = "200", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = MessageSendCancelResponseDto.class)))
@PostMapping(value = "/cancel/single", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<byte[]> cancelSingle(
@Valid @RequestBody MessageSendCancelSingleRequestDto body,
HttpServletRequest request,
RequestUserContext ctx
) {
return messageSendService.cancelSingle(body, request, ctx);
}
@Operation(summary = "Cancel eligible scheduled messages in a bulk send")
@ApiResponse(responseCode = "200", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = MessageSendCancelResponseDto.class)))
@PostMapping(value = "/cancel/bulk", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<byte[]> cancelBulk(
@Valid @RequestBody MessageSendCancelBulkRequestDto body,
HttpServletRequest request,
RequestUserContext ctx
) {
return messageSendService.cancelBulk(body, request, ctx);
}
@Operation(summary = "Email single send") @Operation(summary = "Email single send")
@PostMapping("/email/single/{prjctIdx}") @PostMapping("/email/single/{prjctIdx}")
public MessageSendSingleResponseDto sendEmailSingle( public MessageSendSingleResponseDto sendEmailSingle(
@@ -34,16 +65,6 @@ public class MessageSendController {
return messageSendService.sendEmailSingle(prjctIdx, request, ctx); return messageSendService.sendEmailSingle(prjctIdx, request, ctx);
} }
@Operation(summary = "Email bulk send")
@PostMapping("/email/bulk/{prjctIdx}")
public MessageSendBulkResponseDto sendEmailBulk(
@PathVariable Long prjctIdx,
@Valid @RequestBody MessageSendBulkRequestDto request,
RequestUserContext ctx
) {
return messageSendService.sendEmailBulk(prjctIdx, request, ctx);
}
@Operation(summary = "Kakao Alimtalk single send") @Operation(summary = "Kakao Alimtalk single send")
@PostMapping("/kko/single/{prjctIdx}") @PostMapping("/kko/single/{prjctIdx}")
public MessageSendSingleResponseDto sendKkoSingle( public MessageSendSingleResponseDto sendKkoSingle(
@@ -54,16 +75,6 @@ public class MessageSendController {
return messageSendService.sendKkoSingle(prjctIdx, request, ctx); return messageSendService.sendKkoSingle(prjctIdx, request, ctx);
} }
@Operation(summary = "Kakao Alimtalk bulk send")
@PostMapping("/kko/bulk/{prjctIdx}")
public MessageSendBulkResponseDto sendKkoBulk(
@PathVariable Long prjctIdx,
@Valid @RequestBody MessageSendBulkRequestDto request,
RequestUserContext ctx
) {
return messageSendService.sendKkoBulk(prjctIdx, request, ctx);
}
@Operation(summary = "SMS single send") @Operation(summary = "SMS single send")
@PostMapping("/sms/single/{prjctIdx}") @PostMapping("/sms/single/{prjctIdx}")
public MessageSendSingleResponseDto sendSmsSingle( public MessageSendSingleResponseDto sendSmsSingle(
@@ -73,14 +84,4 @@ public class MessageSendController {
) { ) {
return messageSendService.sendSmsSingle(prjctIdx, request, ctx); return messageSendService.sendSmsSingle(prjctIdx, request, ctx);
} }
@Operation(summary = "SMS bulk send")
@PostMapping("/sms/bulk/{prjctIdx}")
public MessageSendBulkResponseDto sendSmsBulk(
@PathVariable Long prjctIdx,
@Valid @RequestBody MessageSendBulkRequestDto request,
RequestUserContext ctx
) {
return messageSendService.sendSmsBulk(prjctIdx, request, ctx);
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -4,6 +4,7 @@ import com.kri.contact.server.common.enums.ListResetMode;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.List;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@@ -14,10 +15,21 @@ import lombok.Setter;
@Schema(description = "리스트 초기화 요청 DTO") @Schema(description = "리스트 초기화 요청 DTO")
public class ListResetRequestDto { public class ListResetRequestDto {
@NotNull @Schema(description = "기존 초기화 모드(0: 전체, 1: 전체 이력). 신규 선택 필드와 함께 사용할 수 없습니다.", deprecated = true)
@Schema(description = "초기화 범위")
private ListResetMode resetMode; private ListResetMode resetMode;
@Schema(description = "리스트 초기화 여부. true이면 모든 이력과 연동 설문을 선택해야 합니다.")
private Boolean resetList;
@Schema(description = "컨택이력 초기화 여부")
private Boolean resetContactHistory;
@Schema(description = "면접이력 초기화 여부")
private Boolean resetInterviewHistory;
@Schema(description = "상태이력을 초기화할 프로젝트 설문 고유번호 목록. 미선택은 빈 배열")
private List<Long> resetSurveyIds;
@Valid @Valid
@NotNull @NotNull
@Schema(description = "리스트 필터") @Schema(description = "리스트 필터")

View File

@@ -0,0 +1,16 @@
package com.kri.contact.server.dto.list;
import com.kri.contact.server.common.enums.ListResetMode;
import java.util.Set;
public record ListResetScopeDto(
ListResetMode mode,
boolean selective,
boolean contactHistory,
boolean interviewHistory,
Set<Long> surveyIds
) {
public ListResetScopeDto {
surveyIds = Set.copyOf(surveyIds);
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,5 @@
package com.kri.contact.server.dto.list.async;
import java.util.List;
public record ListAsyncActiveJobsDto(List<ListAsyncJobStatusDto> items) {}

View File

@@ -0,0 +1,15 @@
package com.kri.contact.server.dto.list.async;
import com.kri.contact.server.common.enums.ListAsyncJobStatus;
import com.kri.contact.server.common.enums.ListAsyncJobType;
import com.kri.contact.server.common.enums.ListAsyncAssignOperation;
import java.time.LocalDateTime;
import java.util.List;
public record ListAsyncAvailabilityDto(ListAsyncJobType requestedJobType, boolean allowed,
String reasonCode, int blockerCount, List<Blocker> blockers,
ListAsyncMutationCompletionDto mutationCompletion) {
public record Blocker(ListAsyncJobType jobType, ListAsyncJobStatus jobStatus,
String blockingPhase, String requestUserId, String requestUserName,
boolean mine, String jobKey, LocalDateTime regDt, ListAsyncAssignOperation operation) {}
}

View File

@@ -0,0 +1,3 @@
package com.kri.contact.server.dto.list.async;
public record ListAsyncJobAcceptedDto(String jobKey) {}

View File

@@ -0,0 +1,9 @@
package com.kri.contact.server.dto.list.async;
import com.kri.contact.server.common.enums.ListAsyncJobStatus;
import com.kri.contact.server.common.enums.ListAsyncJobType;
import java.time.LocalDateTime;
// Scalar projection avoids OSIV entity staleness and loading request/result/error JSON.
public record ListAsyncJobActivity(String jobKey, ListAsyncJobType jobType,
ListAsyncJobStatus jobStatus, String requestUser, LocalDateTime regDt, String operation) {}

View File

@@ -0,0 +1,20 @@
package com.kri.contact.server.dto.list.async;
import com.kri.contact.server.common.enums.ListAsyncJobStatus;
import com.kri.contact.server.common.enums.ListAsyncJobType;
import com.kri.contact.server.common.enums.ListAsyncAssignOperation;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
public record ListAsyncJobStatusDto(
String jobKey, ListAsyncJobType jobType, ListAsyncAssignOperation operation,
ListAsyncJobStatus jobStatus, String jobStage,
Long totalSidCnt, long completedSidCnt, long completedChunkCnt,
long failedSidCnt, long processedSidCnt, Long remainingSidCnt,
Map<String, Object> progress, Integer failedChunkNo, String errorCode, String errorMessage,
String cancelReason, LocalDateTime regDt, LocalDateTime startedDt, LocalDateTime finishedDt,
List<ResultFile> resultFiles
) {
public record ResultFile(int index, String type, String fileName, long sizeBytes, boolean ready) {}
}

View File

@@ -0,0 +1,6 @@
package com.kri.contact.server.dto.list.async;
import java.time.LocalDateTime;
/** Existing job history summary; no separate data version is stored. */
public record ListAsyncMutationCompletionDto(long finishedCount, LocalDateTime lastFinishedAt) {}

View File

@@ -0,0 +1,5 @@
package com.kri.contact.server.dto.list.async;
public record ListAsyncResultFileDto(
String type, String fileRef, String fileName, long sizeBytes, boolean ready
) {}

View File

@@ -0,0 +1,34 @@
package com.kri.contact.server.dto.list.async;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.kri.contact.server.persistence.entity.TListAsyncJobEntity;
import com.kri.contact.server.service.async.ListAsyncJobStore;
public record ListAsyncSidFailuresDto(long total, int offset, List<Failure> items) {
public record Failure(String sid, String code, int chunkNo) {}
public static ListAsyncSidFailuresDto from(TListAsyncJobEntity job, int offset, int limit) {
var items = new ArrayList<Failure>();
long seen = 0;
Object groups = job.getErrorDetailJson() == null ? null
: job.getErrorDetailJson().get("sidFailureGroups");
if (groups instanceof List<?> entries) {
for (Object entry : entries) {
if (entry instanceof Map<?, ?> group && group.get("sids") instanceof List<?> sids) {
for (Object sid : sids) {
if (seen++ >= offset && items.size() < limit) {
items.add(new Failure((String) sid, (String) group.get("code"),
((Number) group.get("chunkNo")).intValue()));
}
if (items.size() == limit) {
return new ListAsyncSidFailuresDto(ListAsyncJobStore.failedSidCount(job), offset, items);
}
}
}
}
}
return new ListAsyncSidFailuresDto(ListAsyncJobStore.failedSidCount(job), offset, items);
}
}

View File

@@ -0,0 +1,10 @@
package com.kri.contact.server.dto.list.async;
import com.kri.contact.server.common.enums.ListAsyncJobStatus;
import com.kri.contact.server.common.enums.ListAsyncJobType;
// 프로젝트의 다른 사용자에게도 응답한다. 요청자·요청 본문·오류 상세·파일 정보를 담지 않는다.
public record ListUploadResetActiveDto(boolean active, Job job) {
public record Job(ListAsyncJobType jobType, ListAsyncJobStatus jobStatus, String jobStage,
Long totalSidCnt, long processedSidCnt, boolean mine, String jobKey) {}
}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,12 @@
package com.kri.contact.server.dto.message;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
@Schema(description = "Bulk scheduled message cancellation request")
public record MessageSendCancelBulkRequestDto(
@NotBlank @Size(max = 32)
@Schema(description = "NotiHub bulk send key", requiredMode = Schema.RequiredMode.REQUIRED)
String bulkSendKey
) {}

View File

@@ -0,0 +1,11 @@
package com.kri.contact.server.dto.message;
import io.swagger.v3.oas.annotations.media.Schema;
@Schema(description = "NotiHub cancellation counts; non-cancelable items may be included in a successful response")
public record MessageSendCancelResponseDto(
long targetCount,
long canceledCount,
long alreadyCanceledCount,
long notCancelableCount
) {}

View File

@@ -0,0 +1,12 @@
package com.kri.contact.server.dto.message;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
@Schema(description = "Single scheduled message cancellation request")
public record MessageSendCancelSingleRequestDto(
@NotNull @Positive
@Schema(description = "NotiHub send identifier", requiredMode = Schema.RequiredMode.REQUIRED)
Long sendIdx
) {}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,35 @@
package com.kri.contact.server.persistence.entity;
import com.kri.contact.server.persistence.entity.id.TListAsyncJobChunkId;
import io.hypersistence.utils.hibernate.type.json.JsonType;
import jakarta.persistence.Column;
import jakarta.persistence.EmbeddedId;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import java.time.LocalDateTime;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Type;
@Getter
@Setter
@Entity
@Table(name = "t_list_async_job_chunk")
public class TListAsyncJobChunkEntity {
@EmbeddedId
private TListAsyncJobChunkId id;
@Column(name = "operation_type", length = 32, nullable = false)
private String operationType;
@Type(JsonType.class)
@Column(name = "completed_sids_json", columnDefinition = "json", nullable = false)
private List<String> completedSidsJson;
@Column(name = "completed_sid_cnt", nullable = false)
private Integer completedSidCnt;
@Column(name = "recorded_dt", nullable = false)
private LocalDateTime recordedDt;
}

View File

@@ -0,0 +1,108 @@
package com.kri.contact.server.persistence.entity;
import com.kri.contact.server.common.enums.ListAsyncJobStatus;
import com.kri.contact.server.common.enums.ListAsyncJobType;
import com.kri.contact.server.dto.list.async.ListAsyncResultFileDto;
import io.hypersistence.utils.hibernate.type.json.JsonType;
import jakarta.persistence.*;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Type;
@Getter
@Setter
@Entity
@Table(name = "t_list_async_job")
public class TListAsyncJobEntity {
@Id
@Column(name = "job_key", length = 32, nullable = false)
private String jobKey;
@Column(name = "prjct_idx", columnDefinition = "int unsigned", nullable = false)
private Long prjctIdx;
@Enumerated(EnumType.STRING)
@Column(name = "job_type", length = 32, nullable = false)
private ListAsyncJobType jobType;
@Column(name = "request_user", length = 32, nullable = false)
private String requestUser;
@Enumerated(EnumType.STRING)
@Column(name = "job_status", length = 32, nullable = false)
private ListAsyncJobStatus jobStatus;
@Column(name = "job_stage", length = 32, nullable = false)
private String jobStage;
@Type(JsonType.class)
@Column(name = "request_json", columnDefinition = "json", nullable = false)
private Map<String, Object> requestJson;
@Column(name = "input_file_ref", length = 512)
private String inputFileRef;
@Column(name = "total_sid_cnt")
private Long totalSidCnt;
@Column(name = "completed_sid_cnt", nullable = false)
private long completedSidCnt;
@Column(name = "completed_chunk_cnt", nullable = false)
private long completedChunkCnt;
@Type(JsonType.class)
@Column(name = "progress_json", columnDefinition = "json")
private Map<String, Object> progressJson;
@Column(name = "list_upload_log_id", length = 32)
private String listUploadLogId;
@Column(name = "list_reset_log_id", length = 32)
private String listResetLogId;
@Column(name = "failed_chunk_no")
private Integer failedChunkNo;
@Column(name = "error_code", length = 64)
private String errorCode;
@Column(name = "error_message", length = 2048)
private String errorMessage;
@Type(JsonType.class)
@Column(name = "error_detail_json", columnDefinition = "json")
private Map<String, Object> errorDetailJson;
@Column(name = "cancel_reason", length = 64)
private String cancelReason;
@Column(name = "cancel_request_user", length = 32)
private String cancelRequestUser;
@Column(name = "cancel_requested_dt")
private LocalDateTime cancelRequestedDt;
@Type(JsonType.class)
@Column(name = "result_files_json", columnDefinition = "json")
private List<ListAsyncResultFileDto> resultFilesJson;
@Column(name = "owner_instance", length = 64, nullable = false)
private String ownerInstance;
@Column(name = "reg_dt", nullable = false)
private LocalDateTime regDt;
@Column(name = "mod_dt", nullable = false)
private LocalDateTime modDt;
@Column(name = "started_dt")
private LocalDateTime startedDt;
@Column(name = "finished_dt")
private LocalDateTime finishedDt;
}

View File

@@ -154,23 +154,6 @@ public class TListCallHistEntity {
.build(); .build();
} }
public void updateCallResult(ListCallCloseRequestDto request, LocalDateTime endDt) {
if (isCompletedRequest(request)) {
this.endDt = endDt;
this.callStatus = CallStatus.CALL_CLOSE;
}
if (isPositive(request.getTotalTime())) {
this.totalTime = request.getTotalTime();
}
if (isPositive(request.getTalkTime())) {
this.talkTime = request.getTalkTime();
}
this.mediaServerId = request.getMediaServerId();
this.mediaServerName = request.getMediaServerName();
if (hasText(request.getRecordFileName())) {
this.recordFileName = request.getRecordFileName();
}
}
public boolean markUserHangup(LocalDateTime endDt) { public boolean markUserHangup(LocalDateTime endDt) {
if (this.callStatus == CallStatus.CALL_CLOSE) { if (this.callStatus == CallStatus.CALL_CLOSE) {
@@ -210,9 +193,6 @@ public class TListCallHistEntity {
return value != null && value > 0; return value != null && value > 0;
} }
private static boolean hasText(String value) {
return value != null && !value.isBlank();
}
private static String defaultString(String value) { private static String defaultString(String value) {
return value == null ? "" : value; return value == null ? "" : value;

View File

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

View File

@@ -2,7 +2,6 @@ package com.kri.contact.server.persistence.entity;
import static com.kri.contact.server.common.consts.ContactConstant.DEFAULT_CALLER_TELNUM; import static com.kri.contact.server.common.consts.ContactConstant.DEFAULT_CALLER_TELNUM;
import com.kri.common.feature.datetime.DateTimeUtil;
import com.kri.contact.server.common.enums.ProjectStatus; import com.kri.contact.server.common.enums.ProjectStatus;
import com.kri.contact.server.dto.project.ProjectCreateRequestDto; import com.kri.contact.server.dto.project.ProjectCreateRequestDto;
import com.kri.contact.server.dto.project.ProjectInfoDto; import com.kri.contact.server.dto.project.ProjectInfoDto;
@@ -115,32 +114,16 @@ public class TPrjctEntity {
@Column(name = "del_dt") @Column(name = "del_dt")
private LocalDateTime delDt; private LocalDateTime delDt;
public static TPrjctEntity fromDto(ProjectInfoDto dto) {
return TPrjctEntity.builder()
.prjctCd(dto.getPrjctCd())
.prjctStatus(dto.getPrjctStatus().getCode())
.prjctNm(dto.getPrjctName())
.itrntPrjctCd(dto.getItrntPrjctCd())
.ownerDept(dto.getOwnerDept())
.ownerFw(dto.getOwnerFw())
.callerTelNum(dto.getCallerTelNum())
.ff(dto.getFf())
.useContactSenario(dto.getUseContactSenario())
.contactSenario(dto.getContactSenario())
.regUser(dto.getRegUser())
.regDt(DateTimeUtil.nowKstLocalDateTime())
.build();
}
public static TPrjctEntity create(ProjectCreateRequestDto req, String prjctCd, String regUser, public static TPrjctEntity create(ProjectCreateRequestDto req, String prjctCd, String regUser,
LocalDateTime regDt) { LocalDateTime regDt) {
return TPrjctEntity.builder() return TPrjctEntity.builder()
.prjctCd(prjctCd) .prjctCd(prjctCd)
.prjctStatus(ProjectStatus.STANDBY.getCode()) .prjctStatus(ProjectStatus.STANDBY.getCode())
.prjctNm(req.getPrjctName()) .prjctNm(req.prjctName())
.itrntPrjctCd(req.getItrntPrjctCd()) .itrntPrjctCd(req.itrntPrjctCd())
.ownerDept(req.getOwnerDept()) .ownerDept(req.ownerDept())
.ownerFw(req.getOwnerFw()) .ownerFw(req.ownerFw())
.callerTelNum(DEFAULT_CALLER_TELNUM) .callerTelNum(DEFAULT_CALLER_TELNUM)
.ff(false) .ff(false)
.useContactSenario(false) .useContactSenario(false)

View File

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

View File

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

View File

@@ -0,0 +1,22 @@
package com.kri.contact.server.persistence.entity.id;
import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@Embeddable
public class TListAsyncJobChunkId implements Serializable {
@Column(name = "job_key", length = 32, nullable = false)
private String jobKey;
@Column(name = "chunk_no", nullable = false)
private Integer chunkNo;
}

Some files were not shown because too many files have changed in this diff Show More