spotlessApply 적용

This commit is contained in:
2025-12-11 13:47:57 +09:00
parent ec19cf533a
commit d798dc16f9
14 changed files with 261 additions and 279 deletions

View File

@@ -219,7 +219,7 @@ public class CommonCodeApiController {
// .map(Clazzes::new)
// .toList();
//변화탐지 clazz API : enum -> 공통코드로 변경
// 변화탐지 clazz API : enum -> 공통코드로 변경
List<CommonCodeDto.Clazzes> list =
commonCodeUtil.getChildCodesByParentCode("0000").stream()
.map(

View File

@@ -8,17 +8,11 @@ import org.springframework.http.HttpStatus;
public enum AuthErrorCode implements ErrorCode {
// 🔐 로그인 관련
LOGIN_ID_NOT_FOUND(
"LOGIN_ID_NOT_FOUND",
HttpStatus.UNAUTHORIZED),
LOGIN_ID_NOT_FOUND("LOGIN_ID_NOT_FOUND", HttpStatus.UNAUTHORIZED),
LOGIN_PASSWORD_MISMATCH(
"LOGIN_PASSWORD_MISMATCH",
HttpStatus.UNAUTHORIZED),
LOGIN_PASSWORD_MISMATCH("LOGIN_PASSWORD_MISMATCH", HttpStatus.UNAUTHORIZED),
LOGIN_PASSWORD_EXCEEDED(
"LOGIN_PASSWORD_EXCEEDED",
HttpStatus.UNAUTHORIZED);
LOGIN_PASSWORD_EXCEEDED("LOGIN_PASSWORD_EXCEEDED", HttpStatus.UNAUTHORIZED);
private final String code;
private final HttpStatus status;

View File

@@ -20,11 +20,9 @@ public class ApiResponseDto<T> {
@JsonInclude(JsonInclude.Include.NON_NULL)
private T errorData;
@JsonIgnore
private HttpStatus httpStatus;
@JsonIgnore private HttpStatus httpStatus;
@JsonIgnore
private Long errorLogUid;
@JsonIgnore private Long errorLogUid;
public ApiResponseDto(T data) {
this.data = data;
@@ -116,9 +114,7 @@ public class ApiResponseDto<T> {
}
}
/**
* Error가 아닌 Business상 성공이거나 실패인 경우, 메세지 함께 전달하기 위한 object
*/
/** Error가 아닌 Business상 성공이거나 실패인 경우, 메세지 함께 전달하기 위한 object */
@Getter
public static class ResponseObj {

View File

@@ -63,7 +63,8 @@ public class AuthController {
@ExampleObject(
name = "아이디 입력 오류",
description = "존재하지 않는 아이디",
value = """
value =
"""
{
"code": "LOGIN_ID_NOT_FOUND",
"message": "아이디를 잘못 입력하셨습니다."
@@ -72,7 +73,8 @@ public class AuthController {
@ExampleObject(
name = "비밀번호 입력 오류 (4회 이하)",
description = "아이디는 정상, 비밀번호를 여러 번 틀린 경우",
value = """
value =
"""
{
"code": "LOGIN_PASSWORD_MISMATCH",
"message": "비밀번호를 잘못 입력하셨습니다."
@@ -81,14 +83,14 @@ public class AuthController {
@ExampleObject(
name = "비밀번호 오류 횟수 초과",
description = "비밀번호 5회 이상 오류로 계정 잠김",
value = """
value =
"""
{
"code": "LOGIN_PASSWORD_EXCEEDED",
"message": "비밀번호 오류 횟수를 초과하여 이용하실 수 없습니다. 로그인 오류에 대해 관리자에게 문의하시기 바랍니다."
}
""")
}
))
}))
})
public ApiResponseDto<TokenResponse> signin(
@io.swagger.v3.oas.annotations.parameters.RequestBody(
@@ -210,7 +212,5 @@ public class AuthController {
return ApiResponseDto.createOK(ResponseEntity.noContent().build());
}
public record TokenResponse(String status, String accessToken, String refreshToken) {
}
public record TokenResponse(String status, String accessToken, String refreshToken) {}
}

View File

@@ -51,7 +51,6 @@ public class MembersApiController {
return ApiResponseDto.ok(membersService.findByMembers(searchReq));
}
@Operation(summary = "사용자 비밀번호 변경", description = "사용자 비밀번호 변경")
@ApiResponses(
value = {
@@ -67,7 +66,8 @@ public class MembersApiController {
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PatchMapping("/{memberId}/password")
public ApiResponseDto<String> resetPassword(@PathVariable String memberId, @RequestBody @Valid MembersDto.InitReq initReq) {
public ApiResponseDto<String> resetPassword(
@PathVariable String memberId, @RequestBody @Valid MembersDto.InitReq initReq) {
authenticationManager.authenticate(
new UsernamePasswordAuthenticationToken(memberId, initReq.getTempPassword()));

View File

@@ -32,14 +32,10 @@ public class MembersDto {
private String tempPassword;
private String status;
private String statusName;
@JsonFormatDttm
private ZonedDateTime createdDttm;
@JsonFormatDttm
private ZonedDateTime updatedDttm;
@JsonFormatDttm
private ZonedDateTime firstLoginDttm;
@JsonFormatDttm
private ZonedDateTime lastLoginDttm;
@JsonFormatDttm private ZonedDateTime createdDttm;
@JsonFormatDttm private ZonedDateTime updatedDttm;
@JsonFormatDttm private ZonedDateTime firstLoginDttm;
@JsonFormatDttm private ZonedDateTime lastLoginDttm;
public Basic(
Long id,
@@ -55,8 +51,7 @@ public class MembersDto {
ZonedDateTime createdDttm,
ZonedDateTime updatedDttm,
ZonedDateTime firstLoginDttm,
ZonedDateTime lastLoginDttm
) {
ZonedDateTime lastLoginDttm) {
this.id = id;
this.uuid = uuid;
this.userRole = userRole;
@@ -82,7 +77,6 @@ public class MembersDto {
StatusType type = EnumType.fromId(StatusType.class, status);
return type.getText();
}
}
@Getter
@@ -91,7 +85,9 @@ public class MembersDto {
@AllArgsConstructor
public static class SearchReq {
@Schema(description = "전체, 관리자(ROLE_ADMIN), 라벨러(ROLE_LABELER), 검수자(ROLE_REVIEWER)", example = "")
@Schema(
description = "전체, 관리자(ROLE_ADMIN), 라벨러(ROLE_LABELER), 검수자(ROLE_REVIEWER)",
example = "")
private String userRole;
@Schema(description = "키워드", example = "홍길동")

View File

@@ -36,7 +36,6 @@ public class AdminService {
membersCoreService.updateMembers(uuid, updateReq);
}
/**
* 관리자 계정 미사용 처리
*

View File

@@ -77,7 +77,6 @@ public class MembersCoreService {
membersRepository.save(memberEntity);
}
/**
* 관리자 계정 미사용 처리
*
@@ -92,7 +91,6 @@ public class MembersCoreService {
membersRepository.save(memberEntity);
}
/**
* 패스워드 변경
*
@@ -112,6 +110,7 @@ public class MembersCoreService {
memberEntity.setUpdatedDttm(ZonedDateTime.now());
membersRepository.save(memberEntity);
}
//
/**
@@ -131,7 +130,10 @@ public class MembersCoreService {
* @return
*/
public String getUserStatus(SignInRequest request) {
MemberEntity memberEntity = membersRepository.findByUserId(request.getUsername()).orElseThrow(MemberNotFoundException::new);
MemberEntity memberEntity =
membersRepository
.findByUserId(request.getUsername())
.orElseThrow(MemberNotFoundException::new);
return memberEntity.getStatus();
}
}

View File

@@ -61,8 +61,7 @@ public class CommonCodeRepositoryImpl implements CommonCodeRepositoryCustom {
.on(child.deleted.isFalse().or(child.deleted.isNull()))
.where(
commonCodeEntity.parent.isNull(),
commonCodeEntity.deleted.isFalse().or(commonCodeEntity.deleted.isNull())
)
commonCodeEntity.deleted.isFalse().or(commonCodeEntity.deleted.isNull()))
.orderBy(commonCodeEntity.order.asc(), child.order.asc())
.fetch();
}

View File

@@ -68,10 +68,11 @@ public class MembersRepositoryImpl implements MembersRepositoryCustom {
String contains = "%" + searchReq.getKeyword() + "%";
builder.and(
memberEntity.name.likeIgnoreCase(contains)
memberEntity
.name
.likeIgnoreCase(contains)
.or(memberEntity.userId.likeIgnoreCase(contains))
.or(memberEntity.employeeNo.likeIgnoreCase(contains))
);
.or(memberEntity.employeeNo.likeIgnoreCase(contains)));
}
// 권한
@@ -95,8 +96,7 @@ public class MembersRepositoryImpl implements MembersRepositoryCustom {
memberEntity.createdDttm,
memberEntity.updatedDttm,
memberEntity.firstLoginDttm,
memberEntity.lastLoginDttm
))
memberEntity.lastLoginDttm))
.from(memberEntity)
.where(builder)
.offset(pageable.getOffset())
@@ -104,11 +104,7 @@ public class MembersRepositoryImpl implements MembersRepositoryCustom {
.orderBy(memberEntity.createdDttm.desc())
.fetch();
long total =
queryFactory
.select(memberEntity)
.from(memberEntity)
.fetchCount();
long total = queryFactory.select(memberEntity).from(memberEntity).fetchCount();
return new PageImpl<>(content, pageable, total);
}