관리자 관리수정, 에러코드 공통 추가
This commit is contained in:
@@ -2,7 +2,6 @@ package com.kamco.cd.kamcoback.members.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.members.dto.SignInRequest;
|
||||
import com.kamco.cd.kamcoback.postgres.core.MembersCoreService;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -14,26 +13,6 @@ public class AuthService {
|
||||
|
||||
private final MembersCoreService membersCoreService;
|
||||
|
||||
/**
|
||||
* 로그인 일시 저장
|
||||
*
|
||||
* @param uuid
|
||||
*/
|
||||
@Transactional
|
||||
public void saveLogin(UUID uuid) {
|
||||
membersCoreService.saveLogin(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 로그인 실패 저장
|
||||
*
|
||||
* @param uuid
|
||||
*/
|
||||
@Transactional
|
||||
public void loginFail(UUID uuid) {
|
||||
membersCoreService.loginFail(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 사용자 상태 조회
|
||||
*
|
||||
|
||||
@@ -35,7 +35,7 @@ public class MembersService {
|
||||
* @param initReq
|
||||
*/
|
||||
@Transactional
|
||||
public void resetPassword(Long id, MembersDto.InitReq initReq) {
|
||||
public void resetPassword(String id, MembersDto.InitReq initReq) {
|
||||
if (!isValidPassword(initReq.getPassword())) {
|
||||
throw new CustomApiException("WRONG_PASSWORD", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
@@ -49,7 +49,8 @@ public class MembersService {
|
||||
* @return
|
||||
*/
|
||||
private boolean isValidPassword(String password) {
|
||||
String regex = "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)(?=.*[!@#$]).{8,20}$";
|
||||
return Pattern.matches(regex, password);
|
||||
String passwordPattern =
|
||||
"^(?=.*[A-Za-z])(?=.*\\d)(?=.*[!@#$%^&*()_+\\-\\[\\]{};':\"\\\\|,.<>/?]).{8,20}$";
|
||||
return Pattern.matches(passwordPattern, password);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user