251222_04_ENH : RequestBody에 Valid 적용 및 중괄호 스타일 통일

This commit is contained in:
2025-12-22 16:50:36 +09:00
parent cf3adf883b
commit 09e0b4ca05
35 changed files with 209 additions and 124 deletions

View File

@@ -16,7 +16,7 @@ public class LoginResponseDto {
@Schema(description = "사용자 정보")
private JwtUserClaimsDto user;
public static LoginResponseDto from(String accessToken, JwtUserClaimsDto jwtUserClaims){
public static LoginResponseDto from(String accessToken, JwtUserClaimsDto jwtUserClaims) {
return LoginResponseDto.builder()
.accessToken(accessToken)
.user(jwtUserClaims)

View File

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

View File

@@ -5,6 +5,9 @@ import com.kri.contact.server.common.enums.ProjectStatus;
import com.kri.contact.server.common.enums.SurveyType;
import com.kri.contact.server.persistence.entity.TPrjctEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import java.time.LocalDateTime;
@@ -16,45 +19,63 @@ import java.time.LocalDateTime;
@AllArgsConstructor
@Schema(description = "프로젝트 정보")
public class ProjectInfoDto {
@NotNull
@Schema(description = "프로젝트 고유 번호")
private Long prjctIdx;
@Size(max = 32)
@NotBlank
@Schema(description = "프로젝트 코드")
private String prjctCd;
@NotNull
@Schema(description = "프로젝트 진행 상태")
private ProjectStatus prjctStatus;
@Size(max = 128)
@NotBlank
@Schema(description = "프로젝트 명")
private String prjctName;
@Size(max = 32)
@NotBlank
@Schema(description = "인트라넷 프로젝트 코드")
private String itrntPrjctCd;
@Size(max = 32)
@NotBlank
@Schema(description = "담당 그룹")
private String ownerDept;
@Size(max = 16)
@NotBlank
@Schema(description = "담당 실사")
private String ownerFw;
@NotNull
@Schema(description = "설문지 타입")
private SurveyType surveyTy;
@Size(max = 32)
@Schema(description = "내부 설문 시스템 프로젝트 코드")
private String surveyPrjctCd;
@Size(max = 128)
@Schema(description = "설문 URL")
private String surveyUrl;
@NotNull
@Schema(description = "면접원 확인사항 여부")
private Boolean ff;
@NotNull
@Schema(description = "컨택 시나리오 사용 여부")
private Boolean useContactSenario;
@Schema(description = "컨택 시나리오")
private String contactSenario;
@Size(max = 32)
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String regUser;
@@ -63,6 +84,7 @@ public class ProjectInfoDto {
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime regDt;
@Size(max = 32)
@Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String modUser;
@@ -71,7 +93,7 @@ public class ProjectInfoDto {
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime modDt;
public static ProjectInfoDto from(TPrjctEntity entity){
public static ProjectInfoDto from(TPrjctEntity entity) {
return ProjectInfoDto.builder()
.prjctIdx(entity.getPrjctIdx())
.prjctCd(entity.getPrjctCd())

View File

@@ -1,6 +1,7 @@
package com.kri.contact.server.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import org.springframework.web.bind.annotation.RequestBody;
@@ -11,6 +12,7 @@ import java.util.List;
@Setter
@Schema(description = "프로젝트 수정 요청")
public class ProjectUpdateRequestDto {
@NotNull
@Schema(description = "프로젝트 정보")
private ProjectInfoDto projectInfo;

View File

@@ -29,7 +29,7 @@ public class ResultCodeDto {
@Schema(description = "결과 코드 라벨")
private String resultCdLbl;
public static ResultCodeDto from(TResultCodeEntity entity){
public static ResultCodeDto from(TResultCodeEntity entity) {
return ResultCodeDto.builder()
.resultCdUUID(UUID.randomUUID().toString())
.prjctIdx(entity.getPrjctIdx())

View File

@@ -40,7 +40,7 @@ public class RoleInfoDto {
private LocalDateTime modDt;
public static RoleInfoDto from(TRoleEntity roleEntity){
public static RoleInfoDto from(TRoleEntity roleEntity) {
return RoleInfoDto.builder()
.roleCd(roleEntity.getRoleCd())
.roleNm(roleEntity.getRoleNm())

View File

@@ -5,6 +5,9 @@ import com.kri.common.datetime.DateTimeUtil;
import com.kri.contact.server.dto.excel.UserUploadDto;
import com.kri.contact.server.persistence.entity.TUserEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import java.time.LocalDateTime;
@@ -16,27 +19,39 @@ import java.time.LocalDateTime;
@AllArgsConstructor
@Schema(description = "사용자 정보")
public class UserInfoDto {
@Size(max = 32)
@NotBlank
@Schema(description = "사용자 ID")
private String userId;
@Size(max = 128)
@NotBlank
@Schema(description = "사용자 PW")
private String userPw;
@Size(max = 32)
@NotBlank
@Schema(description = "사용자 이름")
private String userName;
@Size(max = 32)
@NotBlank
@Schema(description = "사용자 소속 회사")
private String userCmpn;
@Size(max = 32)
@NotBlank
@Schema(description = "사용자 소속 팀")
private String userTeam = "S101";
@NotNull
@Schema(description = "사용자 권한")
private Integer userRole;
@Schema(description = "메모")
private String memo;
@Size(max = 32)
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String regUser;
@@ -45,6 +60,7 @@ public class UserInfoDto {
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime regDt;
@Size(max = 32)
@Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String modUser;
@@ -53,7 +69,7 @@ public class UserInfoDto {
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime modDt;
public static UserInfoDto from(TUserEntity entity){
public static UserInfoDto from(TUserEntity entity) {
return UserInfoDto.builder()
.userId(entity.getUserId())
.userName(entity.getUserNm())
@@ -68,7 +84,7 @@ public class UserInfoDto {
.build();
}
public static UserInfoDto from(UserUploadDto dto, Integer userRole, String regUser){
public static UserInfoDto from(UserUploadDto dto, Integer userRole, String regUser) {
return UserInfoDto.builder()
.userId(dto.getUserId())
.userPw(dto.getUserPw())