解决魔法值问题...

This commit is contained in:
qq213539 2019-12-10 22:19:05 +08:00
parent 374b35200d
commit 592385b43e

View File

@ -45,6 +45,8 @@ public class NamespaceController {
private Pattern namespaceIdCheckPattern = Pattern.compile("^[\\w-]+");
private static final int NAMESPACE_ID_MAX_LENGTH = 128;
/**
* Get namespace list
*
@ -116,7 +118,7 @@ public class NamespaceController {
if (!namespaceIdCheckPattern.matcher(namespaceId).matches()) {
return false;
}
if (namespaceId.length() > 128) {
if (namespaceId.length() > NAMESPACE_ID_MAX_LENGTH) {
return false;
}
if(persistService.countByTenantId(namespaceId) > 0){