사원중복체크 API 추가, 스웨거 토큰 정보 저장 기능 추가
This commit is contained in:
@@ -4,6 +4,7 @@ import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.members.dto.MembersDto;
|
||||
import com.kamco.cd.kamcoback.members.service.AdminService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
@@ -12,6 +13,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@@ -86,4 +88,25 @@ public class AdminApiController {
|
||||
adminService.updateMembers(uuid, updateReq);
|
||||
return ApiResponseDto.createOK(UUID.randomUUID());
|
||||
}
|
||||
|
||||
@Operation(summary = "사번 중복 체크", description = "사번 중복 체크")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "조회 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Boolean.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/{employeeNo}")
|
||||
public ApiResponseDto<Boolean> checkEmployeeNo(
|
||||
@Parameter(description = "중복 체크할 사번", required = true, example = "1234567") @PathVariable
|
||||
String employeeNo) {
|
||||
return ApiResponseDto.ok(adminService.existsByEmployeeNo(employeeNo));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,4 +42,14 @@ public class AdminService {
|
||||
public void updateMembers(UUID uuid, MembersDto.UpdateReq updateReq) {
|
||||
membersCoreService.updateMembers(uuid, updateReq);
|
||||
}
|
||||
|
||||
/**
|
||||
* 사번 중복 체크
|
||||
*
|
||||
* @param employeeNo
|
||||
* @return
|
||||
*/
|
||||
public boolean existsByEmployeeNo(String employeeNo) {
|
||||
return membersCoreService.existsByEmployeeNo(employeeNo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,4 +178,14 @@ public class MembersCoreService {
|
||||
memberEntity.setLoginFailCount(0);
|
||||
membersRepository.save(memberEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 사번 중복체크
|
||||
*
|
||||
* @param employeeNo
|
||||
* @return
|
||||
*/
|
||||
public boolean existsByEmployeeNo(String employeeNo) {
|
||||
return membersRepository.existsByEmployeeNo(employeeNo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,10 @@ token:
|
||||
refresh-cookie-name: kamco-dev # 개발용 쿠키 이름
|
||||
refresh-cookie-secure: false # 로컬 http 테스트면 false
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
persist-authorization: true # 스웨거 새로고침해도 토큰 유지, 로컬스토리지에 저장
|
||||
|
||||
logging:
|
||||
level:
|
||||
org:
|
||||
@@ -64,6 +68,7 @@ logging:
|
||||
security: DEBUG
|
||||
org.springframework.security: DEBUG
|
||||
|
||||
|
||||
mapsheet:
|
||||
upload:
|
||||
skipGdalValidation: true
|
||||
|
||||
@@ -38,4 +38,10 @@ token:
|
||||
refresh-cookie-name: kamco-local # 개발용 쿠키 이름
|
||||
refresh-cookie-secure: false # 로컬 http 테스트면 false
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
persist-authorization: true # 스웨거 새로고침해도 토큰 유지, 로컬스토리지에 저장
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user