회원가입 추가, 역할 추가, spotlessApply 실행
This commit is contained in:
133
src/main/java/com/kamco/cd/kamcoback/members/dto/MembersDto.java
Normal file
133
src/main/java/com/kamco/cd/kamcoback/members/dto/MembersDto.java
Normal file
@@ -0,0 +1,133 @@
|
||||
package com.kamco.cd.kamcoback.members.dto;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.utils.interfaces.EnumValid;
|
||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.UUID;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
public class MembersDto {
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class Basic {
|
||||
|
||||
private Long id;
|
||||
private UUID uuid;
|
||||
private String employeeNo;
|
||||
private String name;
|
||||
private String email;
|
||||
private String status;
|
||||
private String roleName;
|
||||
@JsonFormatDttm private ZonedDateTime createdDttm;
|
||||
@JsonFormatDttm private ZonedDateTime updatedDttm;
|
||||
|
||||
public Basic(
|
||||
Long id,
|
||||
UUID uuid,
|
||||
String employeeNo,
|
||||
String name,
|
||||
String email,
|
||||
String status,
|
||||
String roleName,
|
||||
ZonedDateTime createdDttm,
|
||||
ZonedDateTime updatedDttm) {
|
||||
this.id = id;
|
||||
this.uuid = uuid;
|
||||
this.employeeNo = employeeNo;
|
||||
this.name = name;
|
||||
this.email = email;
|
||||
this.status = status;
|
||||
this.roleName = roleName;
|
||||
this.createdDttm = createdDttm;
|
||||
this.updatedDttm = updatedDttm;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class SearchReq {
|
||||
|
||||
@Schema(description = "이름(name), 이메일(email), 사번(employeeNo)", example = "name")
|
||||
private String field;
|
||||
|
||||
@Schema(description = "키워드", example = "홍길동")
|
||||
private String keyword;
|
||||
|
||||
@Schema(description = "라벨러 포함 여부", example = "true")
|
||||
private boolean labeler = true;
|
||||
|
||||
@Schema(description = "검수자 포함 여부", example = "true")
|
||||
private boolean reviewer = true;
|
||||
|
||||
@Schema(description = "운영자 포함 여부", example = "true")
|
||||
private boolean admin = true;
|
||||
|
||||
// 페이징 파라미터
|
||||
@Schema(description = "페이지 번호 (0부터 시작) ", example = "0")
|
||||
private int page = 0;
|
||||
|
||||
@Schema(description = "페이지 크기", example = "20")
|
||||
private int size = 20;
|
||||
|
||||
public Pageable toPageable() {
|
||||
return PageRequest.of(page, size);
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class AddReq {
|
||||
|
||||
@Schema(description = "사번", example = "11111")
|
||||
@NotBlank
|
||||
@Size(max = 50)
|
||||
private String employeeNo;
|
||||
|
||||
@Schema(description = "이름", example = "홍길동")
|
||||
@NotBlank
|
||||
@Size(min = 2, max = 100)
|
||||
private String name;
|
||||
|
||||
@Schema(description = "패스워드", example = "")
|
||||
@NotBlank
|
||||
@Size(max = 255)
|
||||
private String password;
|
||||
|
||||
@Schema(description = "이메일", example = "gildong@daum.net")
|
||||
@Size(max = 100)
|
||||
private String email;
|
||||
|
||||
public AddReq(String employeeNo, String name, String password, String email) {
|
||||
this.employeeNo = employeeNo;
|
||||
this.name = name;
|
||||
this.password = password;
|
||||
this.email = email;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class RolesDto {
|
||||
|
||||
private UUID uuid;
|
||||
|
||||
@EnumValid(enumClass = RoleType.class)
|
||||
private String roleName;
|
||||
|
||||
public RolesDto(UUID uuid, String roleName) {
|
||||
this.uuid = uuid;
|
||||
this.roleName = roleName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.kamco.cd.kamcoback.members.dto;
|
||||
|
||||
import com.kamco.cd.kamcoback.config.enums.EnumType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum RoleType implements EnumType {
|
||||
ROLE_ADMIN("시스템 관리자"),
|
||||
ROLE_LABELER("라벨러"),
|
||||
ROLE_REVIEWER("검수자");
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user