Compare commits

...

68 Commits

Author SHA1 Message Date
a0f8684798 Merge pull request '261116_01_ENH: 리스트 헤더 여러 줄 텍스트 타입(MULTILINE_TEXT) 및 헤더 색상(list_hder_color) 추가' (#47) from develop into master
Reviewed-on: #47
2026-11-19 06:59:31 +09:00
ad6a302867 261116_01_ENH: 리스트 헤더 여러 줄 텍스트 타입(MULTILINE_TEXT) 및 헤더 색상(list_hder_color) 추가 2026-11-16 12:29:59 +09:00
6aaf35adf6 Merge pull request '261112_01_CLN: 미사용 통화 이력 세션 조회·사용자 종료 API 및 관련 코드 정리' (#46) from develop into master
Reviewed-on: #46
2026-11-12 15:19:18 +09:00
548dca52c3 261112_01_CLN: 미사용 통화 이력 세션 조회·사용자 종료 API 및 관련 코드 정리 2026-11-12 14:01:21 +09:00
d05db04a19 Merge pull request '261110_01_ENH: 템플릿명 최대 128자로 확대' (#45) from develop into master
Reviewed-on: #45
2026-11-11 08:30:31 +09:00
86e4a02759 261110_01_ENH: 템플릿명 최대 128자로 확대 2026-11-10 17:28:32 +09:00
47d350d3f5 Merge pull request 'develop' (#44) from develop into master
Reviewed-on: #44
2026-11-05 11:51:59 +09:00
5f11e3184e 261105_02_CLN: 미사용 동기 처리 메서드 및 관련 코드 정리 2026-11-05 09:39:25 +09:00
3197c4e16f 261105_01_FIX: 리스트 헤더 생성·저장·비교 시 Trim 적용 2026-11-05 09:08:07 +09:00
27dfb4d26f Merge pull request '261103_01_ENH: 현재 인증 사용자 정보 조회 API 추가 및 응답 캐시 방지 적용' (#43) from develop into master
Reviewed-on: #43
2026-11-03 16:56:38 +09:00
ab0eed8587 261103_01_ENH: 현재 인증 사용자 정보 조회 API 추가 및 응답 캐시 방지 적용 2026-11-03 14:09:41 +09:00
2ea40970cd Merge pull request 'develop' (#42) from develop into master
Reviewed-on: #42
2026-11-02 12:13:28 +09:00
c4ef361c3d 261102_02_DOC: 테스트용으로 설정했던 로컬 notihub에 대한 경로를 다시 실서비스로 돌림 2026-11-02 12:08:53 +09:00
b15035cb32 261102_01_ENH: 알림톡 발신 프로필 조회 API 추가 및 템플릿 조회 요청에 senderKey 반영 2026-11-02 12:07:55 +09:00
88e0ddc274 Merge pull request '261029_01_HOT: 템플릿 삭제 Notihub 바이패스 추가 및 삭제 성공 시 대표 템플릿 연결 정보 삭제' (#41) from master into develop
Reviewed-on: #41
2026-10-29 09:05:37 +09:00
cdb63683d8 261029_01_HOT: 템플릿 삭제 Notihub 바이패스 추가 및 삭제 성공 시 대표 템플릿 연결 정보 삭제 2026-10-29 09:04:28 +09:00
d5be6c9b8f Merge pull request 'master' (#40) from master into develop
Reviewed-on: #40
2026-10-28 17:18:32 +09:00
774c02f258 261028_01_HOT: 헤더관리에서 사용 허용, 외주사, 컨택원, 면접원은 disabled처리 2026-10-28 17:16:45 +09:00
ab5e2f2b8e Merge pull request '261027_01_ENH: KART 프로젝트 목록 조회 및 공유 URL 생성 연동 추가' (#39) from develop into master
Reviewed-on: #39
2026-10-28 08:34:50 +09:00
9b0d3ad5c2 261027_01_ENH: KART 프로젝트 목록 조회 및 공유 URL 생성 연동 추가 2026-10-27 15:25:34 +09:00
fe7c1b0e75 Merge pull request 'develop' (#38) from develop into master
Reviewed-on: #38
2026-10-26 08:33:07 +09:00
fc62f9cb38 261023_01_ENH: 비동기 메시지 발송 부분 성공 상태 추가 및 수신처 없는 대상 건너뛰기 2026-10-23 15:11:38 +09:00
05b1aca898 261022_03_ENH: 리스트 초기화 범위 세분화 및 설문별 상태이력 초기화 추가 2026-10-22 16:59:04 +09:00
2399b6f352 261022_02_ENH: 예약 취소 추가 2026-10-22 15:48:53 +09:00
645cc71192 261022_01_ENH: Class에서 record로 변경가능한 Dto들 record로 변경 2026-10-22 10:14:05 +09:00
70ddcdd9c3 261020_04_FIX: BusinessException 적용 및 원본 예외 보존, 결과 파일 만료 기준을 최종 수정 시각으로 변경 2026-10-20 16:38:11 +09:00
64d830fe67 261020_03_FIX: 요청 실패 시 원본 IOException 보존 기록 2026-10-20 16:19:44 +09:00
8f9dda7be1 261020_02_FIX: 요청 실패 시 로그축적 빠져있어서 추가 2026-10-20 16:10:54 +09:00
2dbe803972 261020_01_FIX: 짧은 비동기 작업 종료 시 리스트 및 배정 목록이 갱신되지 않는 오류 수정 2026-10-20 11:57:41 +09:00
a1e84b2f51 Merge branch 'feature-async-list-bulk-work' into develop 2026-10-19 16:23:59 +09:00
f649282d2d 261019_02_BUG: 업로드, 헤더 생성시 origin target 모두 upper로 검사 되도록 버그 수정 2026-10-19 16:23:36 +09:00
dd16d8fb05 Merge pull request '261019_01_ENH: 리스트 대량 작업 비동기 처리 및 프로젝트별 동시 실행 제어 적용, 미사용 코드 정' (#37) from feature-async-list-bulk-work into develop
Reviewed-on: #37
2026-10-19 14:24:07 +09:00
3d1489c5d5 261019_01_ENH: 리스트 대량 작업 비동기 처리 및 프로젝트별 동시 실행 제어 적용, 미사용 코드 정 2026-10-19 14:22:12 +09:00
a1a9a08121 Merge pull request '261013_01_HOT: 리스트 업로드 매 청크마다 헤더를 수정하는 로직오류 수정' (#36) from develop into master
Reviewed-on: #36
2026-10-13 12:29:05 +09:00
27442b2fc0 Merge pull request '261008_01_ENH: 알림톡 템플릿 관련내용 구현 및 발송 구현' (#35) from develop into master
Reviewed-on: #35
2026-10-08 11:36:04 +09:00
5439374711 Merge pull request '261007_02_HOT: 리스트 업데이트 시 listContentItem를 갱신하는 경우 컨택원의 수정으로 인해 항목이 사라질 수 있기 때문에 커맨드 아웃 처리' (#34) from develop into master
Reviewed-on: #34
2026-10-07 15:44:13 +09:00
3c8710f08c Merge pull request '261007_01_ENH: NotiHub 템플릿·발송 리포트 API를 contact-back으로 통합하고 메시지 발송 경로 변경' (#33) from develop into master
Reviewed-on: #33
2026-10-07 11:57:11 +09:00
3cb37c6a6a Merge pull request 'develop' (#32) from develop into master
Reviewed-on: #32
2026-10-07 08:51:03 +09:00
a13007e314 Merge pull request '261002_01_BUG: 동시 설문 이력 요청 시 START가 완료 상태를 덮어쓰는 오류 수정 (semaphore 적용)' (#31) from develop into master
Reviewed-on: #31
2026-10-02 14:58:21 +09:00
34f0f15499 Merge pull request '261001_02_ENH: 사용자 ID 자리수 허용 조건 2~16자리로 변경' (#30) from develop into master
Reviewed-on: #30
2026-10-01 17:08:21 +09:00
c48e1e6ab5 Merge pull request '260929_02_BUG: 로컬 환경 db 경로 수정' (#29) from develop into master
Reviewed-on: #29
2026-10-01 16:20:55 +09:00
006c9d5aa7 Merge pull request '260929_01_ENH: 설문 응답 결과 수정에 대한 기능누락 수정' (#28) from develop into master
Reviewed-on: #28
2026-09-29 11:23:00 +09:00
02551fdc6a Merge pull request 'develop' (#27) from develop into master
Reviewed-on: #27
2026-09-29 10:25:49 +09:00
83b3925467 Merge pull request '260923_01_ENH: kon, kiwi 매핑테이블에 컨택 실행환경을 추가' (#26) from develop into master
Reviewed-on: #26
2026-09-23 08:27:14 +09:00
b171ffd807 Merge pull request 'develop' (#25) from develop into master
Reviewed-on: #25
2026-09-22 15:23:53 +09:00
0106b641cf Merge pull request '260921_02_ENH: survey short url 쓸모가 없어서 폐기' (#24) from develop into master
Reviewed-on: #24
2026-09-21 14:05:36 +09:00
3b95701ed1 Merge pull request '260921_01_ENH: 설문 url 수정 저장시 메타 데이터 없어지는 버그 수정 중' (#23) from develop into master
Reviewed-on: #23
2026-09-21 12:43:26 +09:00
9e0ab9fae6 Merge pull request '260916_01_ENH: SID 대소문자 구분을 위한 임시 테이블 collation 수정' (#22) from develop into master
Reviewed-on: #22
2026-09-16 18:20:16 +09:00
3ca4f72cfa Merge pull request 'develop' (#21) from develop into master
Reviewed-on: #21
2026-09-15 12:33:27 +09:00
969c21b9a5 Merge pull request '260910_01_ENH: 업로드 실패 엑셀에 SID 및 사용자 ID 추가' (#20) from develop into master
Reviewed-on: #20
2026-09-10 12:35:07 +09:00
c9980cc50e Merge pull request '260826_01_ENH: notihub 수정으로 인한 후속 조치' (#19) from develop into master
Reviewed-on: #19
2026-08-26 12:30:46 +09:00
fd9438d619 Merge pull request 'develop' (#18) from develop into master
Reviewed-on: #18
2026-08-20 10:37:41 +09:00
d0d0410f99 Merge pull request 'develop' (#17) from develop into master
Reviewed-on: #17
2026-08-12 08:42:44 +09:00
e785be94b4 Merge pull request '260806_01_ENH: 공용 패키지 업데이트' (#16) from develop into master
Reviewed-on: #16
2026-08-06 14:56:09 +09:00
d17922f137 Merge pull request '260805_02_ENH: 외부 설문에서 리스트 관련 기능 사용시 prjctIdx가 아닌 prjctCd로 동작하게 변경' (#15) from develop into master
Reviewed-on: #15
2026-08-05 16:19:46 +09:00
0106981e7b Merge pull request '260805_01_ENH: 외부 설문에서 리스트 단건 조회, 리스트 헤더조회, 리스트 단건 수정 기능 사용할수 있도록 기능 생성' (#14) from develop into master
Reviewed-on: #14
2026-08-05 12:20:23 +09:00
7df341622e Merge pull request '260803_04_ENH: 문자, 이메일 발송시 타이틀 치환문자 포함하도록 수정' (#13) from develop into master
Reviewed-on: #13
2026-08-03 16:51:14 +09:00
6a72470a3c Merge pull request '260803_03_ENH: 연구는 자기 부서 프로젝트만 보이게 수정' (#12) from develop into master
Reviewed-on: #12
2026-08-03 09:35:02 +09:00
f7c905f9ff Merge pull request '260803_02_ENH: ownerFw 길이 32로 변경' (#11) from develop into master
Reviewed-on: #11
2026-08-03 09:06:01 +09:00
2abd3d8531 Merge pull request '260803_01_ENH: 사용자 id관련 컬럼 길이 증가' (#10) from develop into master
Reviewed-on: #10
2026-08-03 08:55:53 +09:00
aa7d6e4da1 Merge pull request 'develop' (#9) from develop into master
Reviewed-on: #9
2026-07-28 15:17:17 +09:00
91c14eff8c Merge pull request '260727_01_ENH: call history에 상태 추가 및 call start, call close로 분리' (#7) from develop into master
Reviewed-on: #7
2026-07-27 16:39:08 +09:00
82efee2b1f Merge pull request '260724_02_ENH: 메인템플릿 등록/취소 dto body 검증 잘못 되는거 수정' (#6) from develop into master
Reviewed-on: #6
2026-07-24 14:32:32 +09:00
15db53fe9d Merge pull request '260723_01_ENH: 업로드 파일 못찾는 경우 경고 메시지 수정' (#5) from develop into master
Reviewed-on: #5
2026-07-24 14:03:50 +09:00
f15dad9a8b Merge pull request '260716_04_ENH: 리스트 수정 및 리스트 업로드 수정' (#4) from develop into master
Reviewed-on: #4
2026-07-22 16:58:17 +09:00
62ad54107c Merge pull request '260716_03_ENH: 프로젝트 정보에 발신번호 추가' (#3) from develop into master
Reviewed-on: #3
2026-07-16 15:21:17 +09:00
5beb20199f Merge pull request '260716_02_ENH: db source 수정' (#2) from develop into master
Reviewed-on: #2
2026-07-16 10:11:58 +09:00
1738507f83 Merge pull request 'develop' (#1) from develop into master
Reviewed-on: #1
2026-07-16 09:14:07 +09:00
164 changed files with 4656 additions and 1908 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.1"
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,13 +22,12 @@ 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.trim().toUpperCase(
Locale.ROOT)); Locale.ROOT));
public static final String LIST_HEADER_ACCEPT_REGEX = "^[가-힣a-zA-Z0-9()_\\-\\[\\] ]+$"; public static final String LIST_HEADER_ACCEPT_REGEX = "^[가-힣a-zA-Z0-9()_\\-\\[\\] ]+$";
public static final String LIST_HEADER_COLOR_REGEX = "^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$";
public static final List<ListHeaderType> DEFAULT_AND_FILE_TYPE = Stream.concat( public static final List<ListHeaderType> DEFAULT_AND_FILE_TYPE = Stream.concat(
Arrays.stream(ListHeaderTypeDefault.values()) Arrays.stream(ListHeaderTypeDefault.values())
@@ -36,11 +35,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

@@ -22,12 +22,18 @@ public enum ListHeaderType implements CodeEnum<Short> {
EMAIL(ListHeaderTypeSpecific.EMAIL), //31 : 이메일 EMAIL(ListHeaderTypeSpecific.EMAIL), //31 : 이메일
FILE(ListHeaderTypeSpecific.FILE), //81 : 파일업로드 FILE(ListHeaderTypeSpecific.FILE), //81 : 파일업로드
CONTENT_ITEM(ListHeaderTypeSpecific.CONTENT_ITEM), //91 : 목록형 CONTENT_ITEM(ListHeaderTypeSpecific.CONTENT_ITEM), //91 : 목록형
MULTILINE_TEXT(ListHeaderTypeSpecific.MULTILINE_TEXT), //98 : 여러 줄 텍스트
TEXT((short) 99); //99 : 텍스트 TEXT((short) 99); //99 : 텍스트
private final Short code; private final Short code;
ListHeaderType(CodeEnum<Short> source) { this.code = source.getCode();} ListHeaderType(CodeEnum<Short> source) { this.code = source.getCode();}
/** 저장·처리 방식이 일반 텍스트와 동일한 타입 여부 */
public boolean isText() {
return this == TEXT || this == MULTILINE_TEXT;
}
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static ListHeaderType fromCode(Short code) { public static ListHeaderType fromCode(Short code) {
if (code == null) { if (code == null) {

View File

@@ -15,7 +15,8 @@ public enum ListHeaderTypeSpecific implements CodeEnum<Short> {
TEL_NUM((short) 21), //21 : 전화번호 TEL_NUM((short) 21), //21 : 전화번호
EMAIL((short) 31), //31 : 이메일 EMAIL((short) 31), //31 : 이메일
FILE((short) 81), //81 : 파일업로드 FILE((short) 81), //81 : 파일업로드
CONTENT_ITEM((short) 91); //목록형 CONTENT_ITEM((short) 91), //목록형
MULTILINE_TEXT((short) 98); //98 : 여러 줄 텍스트 (텍스트 계열)
private final Short code; private final Short code;

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

@@ -16,10 +16,6 @@ public enum ChannelType implements CodeEnum<Short> {
private final Short code; private final Short code;
ChannelType(CodeEnum<Short> source) {
this.code = source.getCode();
}
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static ChannelType fromCode(Short code) { public static ChannelType fromCode(Short code) {
if (code == null) { if (code == null) {

View File

@@ -13,6 +13,7 @@ import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendCreateRequestDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendCreateRequestDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendInfoDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendInfoDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendResponseDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendResponseDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoSenderProfileDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto;
@@ -31,6 +32,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 +77,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 {
@@ -114,6 +133,13 @@ public class NotiHubApiClient {
return sendBulk("/send-kko/bulk", request); return sendBulk("/send-kko/bulk", request);
} }
public ResponseEntity<List<NotiHubKkoSenderProfileDto>> getKkoSenderProfiles(
HttpServletRequest request,
RequestUserContext ctx
) {
return relay(request, null, new ParameterizedTypeReference<>() {}, ctx);
}
public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList( public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList(
NotiHubKkoTemplateListRequestDto body, NotiHubKkoTemplateListRequestDto body,
HttpServletRequest request, HttpServletRequest request,
@@ -180,6 +206,13 @@ public class NotiHubApiClient {
return relay(request, null, NotiHubTemplateDetailDto.class, ctx); return relay(request, null, NotiHubTemplateDetailDto.class, ctx);
} }
public ResponseEntity<byte[]> deleteTemplate(
HttpServletRequest request,
RequestUserContext ctx
) {
return forward(request, null, null, ctx);
}
public ResponseEntity<NotiHubTemplateDetailDto> createTemplate( public ResponseEntity<NotiHubTemplateDetailDto> createTemplate(
NotiHubTemplateBasicDto template, NotiHubTemplateBasicDto template,
List<MultipartFile> files, List<MultipartFile> files,
@@ -498,7 +531,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

@@ -0,0 +1,11 @@
package com.kri.contact.server.common.external.notihub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
@Schema(description = "Kakao sender profile")
public record NotiHubKkoSenderProfileDto(
String senderKey,
String name,
String uuid
) {
}

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

@@ -1,21 +1,17 @@
package com.kri.contact.server.common.external.notihub.dto; package com.kri.contact.server.common.external.notihub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
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 {
@Schema(description = "Selected sender profile key; validated by NotiHub", requiredMode = Schema.RequiredMode.REQUIRED)
String senderKey,
@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,17 @@
package com.kri.contact.server.common.external.notihub.dto; package com.kri.contact.server.common.external.notihub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter public record NotiHubKkoTemplateListRequestDto(
@NoArgsConstructor
public class NotiHubKkoTemplateListRequestDto {
@Schema(description = "Selected sender profile key; validated by NotiHub", requiredMode = Schema.RequiredMode.REQUIRED)
String senderKey,
@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

@@ -27,7 +27,7 @@ public class NotiHubTemplateBasicDto extends NotiHubExtensibleDto {
private Short tmplatPurpose; private Short tmplatPurpose;
@NotBlank @NotBlank
@Size(max = 32) @Size(max = 128)
private String tmplatNm; private String tmplatNm;
@Size(max = 128) @Size(max = 128)

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

@@ -1,5 +1,6 @@
package com.kri.contact.server.controller; package com.kri.contact.server.controller;
import com.kri.common.feature.auth.dto.JwtUserClaimsDto;
import com.kri.common.feature.datetime.DateTimeUtil; 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.auth.LoginRequestDto; import com.kri.contact.server.dto.auth.LoginRequestDto;
@@ -11,6 +12,10 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.CacheControl;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.CurrentSecurityContext;
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.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -35,11 +40,19 @@ 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;
} }
@Operation(summary = "현재 인증 사용자 조회")
@GetMapping("/my-info")
public ResponseEntity<JwtUserClaimsDto> myInfo(
@CurrentSecurityContext(expression = "authentication.details") JwtUserClaimsDto user
) {
return ResponseEntity.ok().cacheControl(CacheControl.noStore()).body(user);
}
@Operation(summary = "로그아웃 요청") @Operation(summary = "로그아웃 요청")
@PostMapping("/logout/{userId}") @PostMapping("/logout/{userId}")
public boolean logout(@PathVariable String userId, RequestUserContext ctx) { public boolean logout(@PathVariable String userId, RequestUserContext ctx) {

View File

@@ -0,0 +1,48 @@
package com.kri.contact.server.controller;
import com.fasterxml.jackson.databind.JsonNode;
import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.service.KartService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
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/kart/project")
@RequiredArgsConstructor
@Validated
public class KartController {
private final KartService kartService;
@GetMapping("/list")
public JsonNode projects(
@RequestParam @NotBlank @Size(max = 32) String intranetCode,
@RequestParam @Min(0) @Max(1) int projectType,
@RequestParam(defaultValue = "") String keyword,
HttpServletRequest request,
RequestUserContext user
) {
return kartService.projects(intranetCode, projectType, keyword, request, user);
}
@PostMapping("/{projectType}/{pkey}/share")
public String reportUrl(
@PathVariable @Min(0) @Max(1) int projectType,
@PathVariable String pkey,
HttpServletRequest request,
RequestUserContext user
) {
return kartService.reportUrl(projectType, pkey, request, user);
}
}

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

@@ -11,8 +11,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
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;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -66,27 +64,4 @@ public class ListCallHistController {
now now
); );
} }
@Operation(summary = "Find list call history by agent session")
@GetMapping("/session/{agentSessionId}")
public ListCallHistDto findByAgentSessionId(
@PathVariable String agentSessionId,
RequestUserContext ctx
) {
return listCallHistService.findByAgentSessionId(
agentSessionId,
ctx.getUserId(),
ctx.getUserCmpn(),
ctx.getUserRole()
);
}
@Operation(summary = "Update Call History at Client Hangup")
@PatchMapping("hangup/{agentSessionId}")
public boolean hangupClient(
@PathVariable String agentSessionId,
RequestUserContext ctx
) {
return listCallHistService.hangupClient(agentSessionId);
}
} }

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

@@ -1,6 +1,7 @@
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.common.external.notihub.dto.NotiHubKkoSenderProfileDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto;
@@ -16,6 +17,7 @@ import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
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;
@@ -36,6 +38,14 @@ public class MessageTemplateController {
private final MessageTemplateService messageTemplateService; private final MessageTemplateService messageTemplateService;
@GetMapping("/kko/profiles")
public ResponseEntity<List<NotiHubKkoSenderProfileDto>> getKkoSenderProfiles(
HttpServletRequest request,
RequestUserContext ctx
) {
return messageTemplateService.getKkoSenderProfiles(request, ctx);
}
@PostMapping(value = "/kko/list", consumes = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/kko/list", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList( public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList(
@Valid @RequestBody NotiHubKkoTemplateListRequestDto body, @Valid @RequestBody NotiHubKkoTemplateListRequestDto body,
@@ -72,6 +82,15 @@ public class MessageTemplateController {
return messageTemplateService.getTemplate(request, ctx); return messageTemplateService.getTemplate(request, ctx);
} }
@DeleteMapping("/{tmplatIdx:[0-9]+}")
public ResponseEntity<byte[]> deleteTemplate(
@PathVariable Long tmplatIdx,
HttpServletRequest request,
RequestUserContext ctx
) {
return messageTemplateService.deleteTemplate(tmplatIdx, request, ctx);
}
@GetMapping("/{tmplatIdx:[0-9]+}/attachment") @GetMapping("/{tmplatIdx:[0-9]+}/attachment")
public ResponseEntity<byte[]> getAttachment( public ResponseEntity<byte[]> getAttachment(
@PathVariable Long tmplatIdx, @PathVariable Long tmplatIdx,

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

@@ -5,6 +5,7 @@ import com.kri.contact.server.common.enums.ListHeaderType;
import com.kri.contact.server.persistence.entity.TListHeaderEntity; import com.kri.contact.server.persistence.entity.TListHeaderEntity;
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.Locale;
import java.util.Objects; import java.util.Objects;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@@ -44,6 +45,9 @@ public class ListHeaderDto {
@Schema(description = "헤더 타입") @Schema(description = "헤더 타입")
private ListHeaderType listHderTy; private ListHeaderType listHderTy;
@Schema(description = "헤더 색상 hex (#RRGGBB 또는 #RRGGBBAA, null: 기본색)")
private String listHderColor;
@NotNull @NotNull
@Schema(description = "필터 사용 여부") @Schema(description = "필터 사용 여부")
private Boolean useFilter = false; private Boolean useFilter = false;
@@ -60,6 +64,29 @@ public class ListHeaderDto {
@Schema(description = "면접원 수정가능 여부") @Schema(description = "면접원 수정가능 여부")
private Boolean useIntrvwerEdit = false; private Boolean useIntrvwerEdit = false;
public String getListHderNm() {
return listHderNm == null ? null : listHderNm.trim();
}
public void setListHderNm(String listHderNm) {
this.listHderNm = listHderNm == null ? null : listHderNm.trim();
}
public String getListHderColor() {
return normalizeColor(listHderColor);
}
public void setListHderColor(String listHderColor) {
this.listHderColor = normalizeColor(listHderColor);
}
private static String normalizeColor(String color) {
if (color == null || color.isBlank()) {
return null;
}
return color.trim().toUpperCase(Locale.ROOT);
}
public static ListHeaderDto fromEntity(TListHeaderEntity entity) { public static ListHeaderDto fromEntity(TListHeaderEntity entity) {
return ListHeaderDto.builder() return ListHeaderDto.builder()
.prjctIdx(entity.getPrjctIdx()) .prjctIdx(entity.getPrjctIdx())
@@ -68,6 +95,7 @@ public class ListHeaderDto {
.listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad())) .listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad()))
.listHderNm(entity.getListHderNm()) .listHderNm(entity.getListHderNm())
.listHderTy(ListHeaderType.fromCode(entity.getListHderTy())) .listHderTy(ListHeaderType.fromCode(entity.getListHderTy()))
.listHderColor(entity.getListHderColor())
.useFilter(entity.getUseFilter()) .useFilter(entity.getUseFilter())
.useColView(entity.getUseColView()) .useColView(entity.getUseColView())
.useIntrvwerView(entity.getUseIntrvwerView()) .useIntrvwerView(entity.getUseIntrvwerView())
@@ -83,6 +111,7 @@ public class ListHeaderDto {
.listHderGrad(src.getListHderGrad()) .listHderGrad(src.getListHderGrad())
.listHderNm(src.getListHderNm()) .listHderNm(src.getListHderNm())
.listHderTy(src.getListHderTy()) .listHderTy(src.getListHderTy())
.listHderColor(src.getListHderColor())
.useFilter(src.getUseFilter()) .useFilter(src.getUseFilter())
.useColView(src.getUseColView()) .useColView(src.getUseColView())
.useIntrvwerView(src.getUseIntrvwerView()) .useIntrvwerView(src.getUseIntrvwerView())
@@ -96,7 +125,7 @@ public class ListHeaderDto {
.listHderId(headerId) .listHderId(headerId)
.listHderOrder((short) headerId) .listHderOrder((short) headerId)
.listHderGrad(ListHeaderGrade.COMMON) .listHderGrad(ListHeaderGrade.COMMON)
.listHderNm(headerName) .listHderNm(headerName == null ? null : headerName.trim())
.listHderTy(type) .listHderTy(type)
.useFilter(true) .useFilter(true)
.useColView(true) .useColView(true)
@@ -109,13 +138,13 @@ public class ListHeaderDto {
return Objects.equals(listHderId, dto.listHderId) && return Objects.equals(listHderId, dto.listHderId) &&
Objects.equals(listHderOrder, dto.listHderOrder) && Objects.equals(listHderOrder, dto.listHderOrder) &&
Objects.equals(listHderGrad, dto.listHderGrad) && Objects.equals(listHderGrad, dto.listHderGrad) &&
Objects.equals(listHderNm, dto.listHderNm) && Objects.equals(getListHderNm(), dto.getListHderNm()) &&
Objects.equals(listHderTy, dto.listHderTy); Objects.equals(listHderTy, dto.listHderTy);
} }
public boolean isEqualSimple(ListHeaderDto dto) { public boolean isEqualSimple(ListHeaderDto dto) {
return Objects.equals(listHderId, dto.listHderId) && return Objects.equals(listHderId, dto.listHderId) &&
Objects.equals(listHderGrad, dto.listHderGrad) && Objects.equals(listHderGrad, dto.listHderGrad) &&
Objects.equals(listHderNm, dto.listHderNm); Objects.equals(getListHderNm(), dto.getListHderNm());
} }
} }

View File

@@ -32,6 +32,7 @@ public class ListHeaderWithFilterContentDto extends ListHeaderDto {
.listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad())) .listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad()))
.listHderNm(entity.getListHderNm()) .listHderNm(entity.getListHderNm())
.listHderTy(ListHeaderType.fromCode(entity.getListHderTy())) .listHderTy(ListHeaderType.fromCode(entity.getListHderTy()))
.listHderColor(entity.getListHderColor())
.useFilter(entity.getUseFilter()) .useFilter(entity.getUseFilter())
.useColView(entity.getUseColView()) .useColView(entity.getUseColView())
.useIntrvwerView(entity.getUseIntrvwerView()) .useIntrvwerView(entity.getUseIntrvwerView())

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

@@ -1,23 +0,0 @@
package com.kri.contact.server.dto.message;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "MessageFailedChunkDto")
public class MessageFailedChunkDto {
@Schema(description = "chunkIndex")
private int chunkIndex;
@Schema(description = "from")
private int from;
@Schema(description = "to")
private int to;
@Schema(description = "targetCount")
private int targetCount;
@Schema(description = "errorMessage")
private 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

@@ -1,28 +0,0 @@
package com.kri.contact.server.dto.message;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.ArrayList;
import java.util.List;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "MessageBulkSendResponseDto")
public class MessageSendBulkResponseDto {
@Schema(description = "bulkSendKey")
private String bulkSendKey;
@Schema(description = "targetCount")
private int targetCount;
@Schema(description = "requestCount")
private int requestCount;
@Schema(description = "acceptCount")
private int acceptCount;
@Schema(description = "failCount")
private int failCount;
@Builder.Default
@Schema(description = "failedChunks")
private List<MessageFailedChunkDto> 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();
} }
} }

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