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

This commit is contained in:
2026-10-22 09:48:37 +09:00
parent cb98f4ccd3
commit 8d82399dc7
10 changed files with 48 additions and 61 deletions

View File

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

View File

@@ -1,16 +1,14 @@
package com.kri.intranet.extension.dto.jwt;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.Builder;
@Builder
@Getter
@Setter
@AllArgsConstructor
public class InternalJwtDto {
public record InternalJwtDto(
@Schema(description = "서비스 ID ex) INTRANET_EXTENSION")
private String serviceId;
String serviceId,
@Schema(description = "서비스명 ex) Intranet Extension Service")
private String serviceName;
String serviceName
) {
}

View File

@@ -1,17 +1,13 @@
package com.kri.intranet.extension.dto.project.request;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "프로젝트 검색 조건 DTO")
public class GetProjectTop10RequestDto {
public record GetProjectTop10RequestDto(
@Schema(description = "프로젝트 자식 일련번호 (p_child_sn LIKE 검색)")
private String childSn; // p_child_sn용 파라미터
String childSn, // p_child_sn용 파라미터
@Schema(description = "제목/의도 통합 키워드 (p_subject / p_intention 공용)")
private String keyword; // p_subject + p_intention 공용 파라미터
String keyword // p_subject + p_intention 공용 파라미터
) {
}

View File

@@ -3,24 +3,22 @@ package com.kri.intranet.extension.dto.project.response;
import com.kri.intranet.extension.entity.project.ProjectBasicInfoEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "프로젝트 조회 결과 DTO")
public class GetProjectTop10ResponseDto {
public record GetProjectTop10ResponseDto(
@Schema(description = "프로젝트 자코드 (p_child_sn)")
private final String childSn;
String childSn,
@Schema(description = "프로젝트 제목 (p_subject 또는 p_subject <p_intention>)")
private final String title;
String title,
@Schema(description = "연구팀 코드 (p_rsch_team)")
private final String researchTeam;
String researchTeam,
@Schema(description = "연구팀 명 (p_rsch_team_name)")
private final String researchTeamName;
String researchTeamName
) {
public static GetProjectTop10ResponseDto from(ProjectBasicInfoEntity e) {
return GetProjectTop10ResponseDto.builder()

View File

@@ -4,16 +4,14 @@ import com.kri.intranet.extension.entity.telnum.ExternalNumberEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "가용 발신번호 조회 결과 DTO")
public class GetCallerTelNumResponseDto {
private String telNum;
private LocalDateTime regDt;
private String userCode;
public record GetCallerTelNumResponseDto(
String telNum,
LocalDateTime regDt,
String userCode
) {
public static GetCallerTelNumResponseDto of(ExternalNumberEntity entity) {
return GetCallerTelNumResponseDto.builder()

View File

@@ -3,20 +3,16 @@ package com.kri.intranet.extension.dto.user;
import com.kri.intranet.extension.entity.user.GroupCodeInfoEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@Getter
@Builder
@EqualsAndHashCode
@Schema(description = "그룹 코드 정보 Dto")
public class GroupCodeInfoDto {
public record GroupCodeInfoDto(
@Schema(description = "그룹 코드")
private String groupCode;
String groupCode,
@Schema(description = "그룹 코드 레이블")
private String groupCodeLabel;
String groupCodeLabel
) {
public static GroupCodeInfoDto from(GroupCodeInfoEntity groupCodeInfo) {
return GroupCodeInfoDto.builder()

View File

@@ -3,28 +3,25 @@ package com.kri.intranet.extension.dto.user;
import com.kri.intranet.extension.entity.user.UserBasicInfoEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;
@Getter
@Builder
@Schema(description = "사용자 ID/PW 검색 응답 DTO")
public class UserBasicInfoDto {
public record UserBasicInfoDto(
@Schema(description = "사용자 ID")
private final String userId;
String userId,
@Builder.Default
@Schema(description = "사용자 소속 회사")
private final String userCmpn = "KRic";
String userCmpn,
@Schema(description = "사용자 이름 (p_name)")
private final String userNm;
String userNm,
@Schema(description = "사용자 팀 (p_depart_now + p_team_now)")
private final String userTeam;
String userTeam,
@Schema(description = "사용자 역할")
private final int userRole;
int userRole
) {
public static UserBasicInfoDto from(UserBasicInfoEntity e) {
return UserBasicInfoDto.builder()
@@ -34,4 +31,8 @@ public class UserBasicInfoDto {
.userRole(e.getUserRole())
.build();
}
public static class UserBasicInfoDtoBuilder {
private String userCmpn = "KRic";
}
}

View File

@@ -1,17 +1,17 @@
package com.kri.intranet.extension.dto.user.request;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "사용자 ID/PW 검색 요청 DTO")
public class GetUserWithIdPwRequestDto {
public record GetUserWithIdPwRequestDto(
@Schema(description = "사용자 ID")
private String userId;
String userId,
@Schema(description = "사용자 PW")
private String userPw;
String userPw
) {
@Override
public String toString() {
return "GetUserWithIdPwRequestDto[redacted]";
}
}

View File

@@ -16,8 +16,8 @@ public class ProjectService {
private final ProjectMapper projectMapper;
public List<GetProjectTop10ResponseDto> getProjectTop10(GetProjectTop10RequestDto getProjectTop10RequestDto) {
String childSn = getProjectTop10RequestDto.getChildSn();
String keyword = getProjectTop10RequestDto.getKeyword();
String childSn = getProjectTop10RequestDto.childSn();
String keyword = getProjectTop10RequestDto.keyword();
List<ProjectBasicInfoEntity> entityList = projectMapper.selectProjectTop10(childSn,keyword);

View File

@@ -17,8 +17,8 @@ public class UserService {
private final UserMapper userMapper;
public UserBasicInfoDto getUserWithIdPw(GetUserWithIdPwRequestDto getUserWithIdPwRequestDto) {
String userId = getUserWithIdPwRequestDto.getUserId();
String userPw = getUserWithIdPwRequestDto.getUserPw();
String userId = getUserWithIdPwRequestDto.userId();
String userPw = getUserWithIdPwRequestDto.userPw();
List<UserBasicInfoEntity> userBasicInfoEntityList = userMapper.selectUserWithIdPw(userId,userPw);