Merge pull request '공통코드 체크 정규식 수정' (#37) from feat/dev_251201 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/37
This commit is contained in:
@@ -43,7 +43,7 @@ public class CommonCodeCoreService
|
|||||||
@CacheEvict(value = "commonCodes", allEntries = true)
|
@CacheEvict(value = "commonCodes", allEntries = true)
|
||||||
public ResponseObj save(CommonCodeDto.AddReq req) {
|
public ResponseObj save(CommonCodeDto.AddReq req) {
|
||||||
|
|
||||||
String regex = "^([A-Z]+|[0-9]+|[A-Z0-9]+(_[A-Z0-9]+)+)$";
|
String regex = "^[A-Z0-9]+(_[A-Z0-9]+)*$";
|
||||||
boolean isValid = req.getCode().matches(regex);
|
boolean isValid = req.getCode().matches(regex);
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
return new ResponseObj(ApiResponseCode.CONFLICT, "공통코드에 영문 대문자, 숫자, 언더바(_)만 입력 가능합니다.");
|
return new ResponseObj(ApiResponseCode.CONFLICT, "공통코드에 영문 대문자, 숫자, 언더바(_)만 입력 가능합니다.");
|
||||||
@@ -204,7 +204,7 @@ public class CommonCodeCoreService
|
|||||||
public ResponseObj getCodeCheckDuplicate(Long parentId, String code) {
|
public ResponseObj getCodeCheckDuplicate(Long parentId, String code) {
|
||||||
Long existsCount = commonCodeRepository.findByParentIdCodeExists(parentId, code);
|
Long existsCount = commonCodeRepository.findByParentIdCodeExists(parentId, code);
|
||||||
|
|
||||||
String regex = "^([A-Z]+|[0-9]+|[A-Z0-9]+(_[A-Z0-9]+)+)$";
|
String regex = "^[A-Z0-9]+(_[A-Z0-9]+)*$";
|
||||||
boolean isValid = code.matches(regex);
|
boolean isValid = code.matches(regex);
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
return new ResponseObj(ApiResponseCode.CONFLICT, "공통코드에 영문 대문자, 숫자, 언더바(_)만 입력 가능합니다.");
|
return new ResponseObj(ApiResponseCode.CONFLICT, "공통코드에 영문 대문자, 숫자, 언더바(_)만 입력 가능합니다.");
|
||||||
|
|||||||
Reference in New Issue
Block a user