251222_04_ENH : RequestBody에 Valid 적용 및 중괄호 스타일 통일
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user