261022_01_ENH: Class에서 record로 변경가능한 Dto들 record로 변경
This commit is contained in:
@@ -37,7 +37,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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-web'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
package com.kri.intranet.extension.dto.jwt;
|
package com.kri.intranet.extension.dto.jwt;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.Builder;
|
||||||
|
|
||||||
@Builder
|
@Builder
|
||||||
@Getter
|
public record InternalJwtDto(
|
||||||
@Setter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class InternalJwtDto {
|
|
||||||
@Schema(description = "서비스 ID ex) INTRANET_EXTENSION")
|
@Schema(description = "서비스 ID ex) INTRANET_EXTENSION")
|
||||||
private String serviceId;
|
String serviceId,
|
||||||
|
|
||||||
@Schema(description = "서비스명 ex) Intranet Extension Service")
|
@Schema(description = "서비스명 ex) Intranet Extension Service")
|
||||||
private String serviceName;
|
String serviceName
|
||||||
|
) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
package com.kri.intranet.extension.dto.project.request;
|
package com.kri.intranet.extension.dto.project.request;
|
||||||
|
|
||||||
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 = "프로젝트 검색 조건 DTO")
|
@Schema(description = "프로젝트 검색 조건 DTO")
|
||||||
public class GetProjectTop10RequestDto {
|
public record GetProjectTop10RequestDto(
|
||||||
|
|
||||||
@Schema(description = "프로젝트 자식 일련번호 (p_child_sn LIKE 검색)")
|
@Schema(description = "프로젝트 자식 일련번호 (p_child_sn LIKE 검색)")
|
||||||
private String childSn; // p_child_sn용 파라미터
|
String childSn, // p_child_sn용 파라미터
|
||||||
|
|
||||||
@Schema(description = "제목/의도 통합 키워드 (p_subject / p_intention 공용)")
|
@Schema(description = "제목/의도 통합 키워드 (p_subject / p_intention 공용)")
|
||||||
private String keyword; // p_subject + p_intention 공용 파라미터
|
String keyword // p_subject + p_intention 공용 파라미터
|
||||||
|
) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,24 +3,22 @@ package com.kri.intranet.extension.dto.project.response;
|
|||||||
import com.kri.intranet.extension.entity.project.ProjectBasicInfoEntity;
|
import com.kri.intranet.extension.entity.project.ProjectBasicInfoEntity;
|
||||||
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 = "프로젝트 조회 결과 DTO")
|
@Schema(description = "프로젝트 조회 결과 DTO")
|
||||||
public class GetProjectTop10ResponseDto {
|
public record GetProjectTop10ResponseDto(
|
||||||
|
|
||||||
@Schema(description = "프로젝트 자코드 (p_child_sn)")
|
@Schema(description = "프로젝트 자코드 (p_child_sn)")
|
||||||
private final String childSn;
|
String childSn,
|
||||||
|
|
||||||
@Schema(description = "프로젝트 제목 (p_subject 또는 p_subject <p_intention>)")
|
@Schema(description = "프로젝트 제목 (p_subject 또는 p_subject <p_intention>)")
|
||||||
private final String title;
|
String title,
|
||||||
|
|
||||||
@Schema(description = "연구팀 코드 (p_rsch_team)")
|
@Schema(description = "연구팀 코드 (p_rsch_team)")
|
||||||
private final String researchTeam;
|
String researchTeam,
|
||||||
|
|
||||||
@Schema(description = "연구팀 명 (p_rsch_team_name)")
|
@Schema(description = "연구팀 명 (p_rsch_team_name)")
|
||||||
private final String researchTeamName;
|
String researchTeamName
|
||||||
|
) {
|
||||||
|
|
||||||
public static GetProjectTop10ResponseDto from(ProjectBasicInfoEntity e) {
|
public static GetProjectTop10ResponseDto from(ProjectBasicInfoEntity e) {
|
||||||
return GetProjectTop10ResponseDto.builder()
|
return GetProjectTop10ResponseDto.builder()
|
||||||
|
|||||||
@@ -4,16 +4,14 @@ import com.kri.intranet.extension.entity.telnum.ExternalNumberEntity;
|
|||||||
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 = "가용 발신번호 조회 결과 DTO")
|
@Schema(description = "가용 발신번호 조회 결과 DTO")
|
||||||
public class GetCallerTelNumResponseDto {
|
public record GetCallerTelNumResponseDto(
|
||||||
|
String telNum,
|
||||||
private String telNum;
|
LocalDateTime regDt,
|
||||||
private LocalDateTime regDt;
|
String userCode
|
||||||
private String userCode;
|
) {
|
||||||
|
|
||||||
public static GetCallerTelNumResponseDto of(ExternalNumberEntity entity) {
|
public static GetCallerTelNumResponseDto of(ExternalNumberEntity entity) {
|
||||||
return GetCallerTelNumResponseDto.builder()
|
return GetCallerTelNumResponseDto.builder()
|
||||||
|
|||||||
@@ -3,20 +3,16 @@ package com.kri.intranet.extension.dto.user;
|
|||||||
import com.kri.intranet.extension.entity.user.GroupCodeInfoEntity;
|
import com.kri.intranet.extension.entity.user.GroupCodeInfoEntity;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Builder
|
@Builder
|
||||||
@EqualsAndHashCode
|
|
||||||
@Schema(description = "그룹 코드 정보 Dto")
|
@Schema(description = "그룹 코드 정보 Dto")
|
||||||
public class GroupCodeInfoDto {
|
public record GroupCodeInfoDto(
|
||||||
|
|
||||||
@Schema(description = "그룹 코드")
|
@Schema(description = "그룹 코드")
|
||||||
private String groupCode;
|
String groupCode,
|
||||||
|
|
||||||
@Schema(description = "그룹 코드 레이블")
|
@Schema(description = "그룹 코드 레이블")
|
||||||
private String groupCodeLabel;
|
String groupCodeLabel
|
||||||
|
) {
|
||||||
|
|
||||||
public static GroupCodeInfoDto from(GroupCodeInfoEntity groupCodeInfo) {
|
public static GroupCodeInfoDto from(GroupCodeInfoEntity groupCodeInfo) {
|
||||||
return GroupCodeInfoDto.builder()
|
return GroupCodeInfoDto.builder()
|
||||||
|
|||||||
@@ -3,28 +3,25 @@ package com.kri.intranet.extension.dto.user;
|
|||||||
import com.kri.intranet.extension.entity.user.UserBasicInfoEntity;
|
import com.kri.intranet.extension.entity.user.UserBasicInfoEntity;
|
||||||
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 = "사용자 ID/PW 검색 응답 DTO")
|
@Schema(description = "사용자 ID/PW 검색 응답 DTO")
|
||||||
public class UserBasicInfoDto {
|
public record UserBasicInfoDto(
|
||||||
@Schema(description = "사용자 ID")
|
@Schema(description = "사용자 ID")
|
||||||
private final String userId;
|
String userId,
|
||||||
|
|
||||||
@Builder.Default
|
|
||||||
@Schema(description = "사용자 소속 회사")
|
@Schema(description = "사용자 소속 회사")
|
||||||
private final String userCmpn = "KRic";
|
String userCmpn,
|
||||||
|
|
||||||
@Schema(description = "사용자 이름 (p_name)")
|
@Schema(description = "사용자 이름 (p_name)")
|
||||||
private final String userNm;
|
String userNm,
|
||||||
|
|
||||||
@Schema(description = "사용자 팀 (p_depart_now + p_team_now)")
|
@Schema(description = "사용자 팀 (p_depart_now + p_team_now)")
|
||||||
private final String userTeam;
|
String userTeam,
|
||||||
|
|
||||||
@Schema(description = "사용자 역할")
|
@Schema(description = "사용자 역할")
|
||||||
private final int userRole;
|
int userRole
|
||||||
|
) {
|
||||||
|
|
||||||
public static UserBasicInfoDto from(UserBasicInfoEntity e) {
|
public static UserBasicInfoDto from(UserBasicInfoEntity e) {
|
||||||
return UserBasicInfoDto.builder()
|
return UserBasicInfoDto.builder()
|
||||||
@@ -34,4 +31,8 @@ public class UserBasicInfoDto {
|
|||||||
.userRole(e.getUserRole())
|
.userRole(e.getUserRole())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class UserBasicInfoDtoBuilder {
|
||||||
|
private String userCmpn = "KRic";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
package com.kri.intranet.extension.dto.user.request;
|
package com.kri.intranet.extension.dto.user.request;
|
||||||
|
|
||||||
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 = "사용자 ID/PW 검색 요청 DTO")
|
@Schema(description = "사용자 ID/PW 검색 요청 DTO")
|
||||||
public class GetUserWithIdPwRequestDto {
|
public record GetUserWithIdPwRequestDto(
|
||||||
|
|
||||||
@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 "GetUserWithIdPwRequestDto[redacted]";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -16,8 +16,8 @@ public class ProjectService {
|
|||||||
private final ProjectMapper projectMapper;
|
private final ProjectMapper projectMapper;
|
||||||
|
|
||||||
public List<GetProjectTop10ResponseDto> getProjectTop10(GetProjectTop10RequestDto getProjectTop10RequestDto) {
|
public List<GetProjectTop10ResponseDto> getProjectTop10(GetProjectTop10RequestDto getProjectTop10RequestDto) {
|
||||||
String childSn = getProjectTop10RequestDto.getChildSn();
|
String childSn = getProjectTop10RequestDto.childSn();
|
||||||
String keyword = getProjectTop10RequestDto.getKeyword();
|
String keyword = getProjectTop10RequestDto.keyword();
|
||||||
|
|
||||||
List<ProjectBasicInfoEntity> entityList = projectMapper.selectProjectTop10(childSn,keyword);
|
List<ProjectBasicInfoEntity> entityList = projectMapper.selectProjectTop10(childSn,keyword);
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ public class UserService {
|
|||||||
private final UserMapper userMapper;
|
private final UserMapper userMapper;
|
||||||
|
|
||||||
public UserBasicInfoDto getUserWithIdPw(GetUserWithIdPwRequestDto getUserWithIdPwRequestDto) {
|
public UserBasicInfoDto getUserWithIdPw(GetUserWithIdPwRequestDto getUserWithIdPwRequestDto) {
|
||||||
String userId = getUserWithIdPwRequestDto.getUserId();
|
String userId = getUserWithIdPwRequestDto.userId();
|
||||||
String userPw = getUserWithIdPwRequestDto.getUserPw();
|
String userPw = getUserWithIdPwRequestDto.userPw();
|
||||||
|
|
||||||
List<UserBasicInfoEntity> userBasicInfoEntityList = userMapper.selectUserWithIdPw(userId,userPw);
|
List<UserBasicInfoEntity> userBasicInfoEntityList = userMapper.selectUserWithIdPw(userId,userPw);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user