@PostMapping
    @Secured(resource = AuthConstants.CONSOLE_RESOURCE_NAME_PREFIX + "namespaces", action = ActionTypes.WRITE)
    public Boolean createNamespace(@RequestParam("customNamespaceId") String namespaceId,
            @RequestParam("namespaceName") String namespaceName,
            @RequestParam(value = "namespaceDesc", required = false) String namespaceDesc) {
        if (StringUtils.isBlank(namespaceId)) {
            namespaceId = UUID.randomUUID().toString();
        } else {
            namespaceId = namespaceId.trim();
            if (!namespaceIdCheckPattern.matcher(namespaceId).matches()) {
                return false;
            }
            if (namespaceId.length() > NAMESPACE_ID_MAX_LENGTH) {
                return false;
            }
            // check unique
            if (namespacePersistService.tenantInfoCountByTenantId(namespaceId) > 0) {
                return false;
            }
        }
        // contains illegal chars
        if (!namespaceNameCheckPattern.matcher(namespaceName).matches()) {
            return false;
        }
        try {
            return namespaceOperationService.createNamespace(namespaceId, namespaceName, namespaceDesc);
        } catch (NacosException e) {
            return false;
        }
    }
@Test
    void testCreateNamespaceWithIllegalName() {
        assertFalse(namespaceController.createNamespace(null, "test@Name", "testDesc"));
        assertFalse(namespaceController.createNamespace(null, "test#Name", "testDesc"));
        assertFalse(namespaceController.createNamespace(null, "test$Name", "testDesc"));
        assertFalse(namespaceController.createNamespace(null, "test%Name", "testDesc"));
        assertFalse(namespaceController.createNamespace(null, "test^Name", "testDesc"));
        assertFalse(namespaceController.createNamespace(null, "test&Name", "testDesc"));
        assertFalse(namespaceController.createNamespace(null, "test*Name", "testDesc"));
    }