diff --git a/pigx-register/src/main/java/com/alibaba/nacos/PigxNacosApplication.java b/pigx-register/src/main/java/com/alibaba/nacos/PigxNacosApplication.java
deleted file mode 100644
index ae6da4938..000000000
--- a/pigx-register/src/main/java/com/alibaba/nacos/PigxNacosApplication.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.nacos;
-
-import com.alibaba.nacos.console.config.ConfigConstants;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.scheduling.annotation.EnableScheduling;
-
-/**
- * @author nacos
- *
- * nacos console 源码运行,方便开发 生产从官网下载zip最新版集群配置运行
- */
-@Slf4j
-@EnableScheduling
-@SpringBootApplication
-public class PigxNacosApplication {
-
- public static void main(String[] args) {
- if (initEnv()) {
- SpringApplication.run(PigxNacosApplication.class, args);
- }
- }
-
- /**
- * 初始化运行环境
- */
- private static boolean initEnv() {
- System.setProperty(ConfigConstants.STANDALONE_MODE, "true");
- System.setProperty(ConfigConstants.AUTH_ENABLED, "true");
- System.setProperty(ConfigConstants.LOG_BASEDIR, "logs");
- System.setProperty(ConfigConstants.LOG_ENABLED, "false");
- System.setProperty(ConfigConstants.NACOS_CONTEXT_PATH, "/nacos");
- return true;
- }
-
-}
diff --git a/pigx-register/src/main/java/com/alibaba/nacos/bootstrap/PigxNacosApplication.java b/pigx-register/src/main/java/com/alibaba/nacos/bootstrap/PigxNacosApplication.java
new file mode 100644
index 000000000..8848e1d58
--- /dev/null
+++ b/pigx-register/src/main/java/com/alibaba/nacos/bootstrap/PigxNacosApplication.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright 1999-2023 Alibaba Group Holding Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.alibaba.nacos.bootstrap;
+
+import com.alibaba.nacos.NacosServerBasicApplication;
+import com.alibaba.nacos.NacosServerWebApplication;
+import com.alibaba.nacos.bootstrap.config.ConfigConstants;
+import com.alibaba.nacos.console.NacosConsole;
+import com.alibaba.nacos.core.listener.startup.NacosStartUp;
+import com.alibaba.nacos.core.listener.startup.NacosStartUpManager;
+import com.alibaba.nacos.sys.env.Constants;
+import com.alibaba.nacos.sys.env.DeploymentType;
+import com.alibaba.nacos.sys.env.EnvUtil;
+import org.springframework.boot.Banner;
+import org.springframework.boot.ResourceBanner;
+import org.springframework.boot.WebApplicationType;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.jmx.export.MBeanExporter;
+import org.springframework.jmx.support.RegistrationPolicy;
+
+/**
+ * Nacos启动类。
+ *
+ * 针对于开发环境的启动类,主要是为了方便开发者开箱即用 PIGX ,而不需要考虑 nacos 的各版本兼容性问题。
+ *
+ * @author lengleng
+ * @date 2025/04/30
+ */
+@SpringBootApplication
+public class PigxNacosApplication {
+
+ private static final String SPRING_JXM_ENABLED = "spring.jmx.enabled";
+
+ public static void main(String[] args) {
+ // 修改这里的配置项,来指定Nacos Web Console的端口
+ System.setProperty(ConfigConstants.NACOS_CONSOLE_PORT, "18080");
+ String type = System.getProperty(Constants.NACOS_DEPLOYMENT_TYPE, Constants.NACOS_DEPLOYMENT_TYPE_MERGED);
+ DeploymentType deploymentType = DeploymentType.getType(type);
+ System.setProperty(ConfigConstants.STANDALONE_MODE, "true");
+ EnvUtil.setDeploymentType(deploymentType);
+ switch (deploymentType) {
+ case MERGED:
+ startWithConsole(args);
+ break;
+ case SERVER:
+ startWithoutConsole(args);
+ break;
+ case CONSOLE:
+ startOnlyConsole(args);
+ break;
+ default:
+ throw new IllegalArgumentException("Unsupported nacos deployment type " + type);
+ }
+ }
+
+ private static void prepareCoreContext(ConfigurableApplicationContext coreContext) {
+ if (coreContext.getEnvironment().getProperty(SPRING_JXM_ENABLED, Boolean.class, false)) {
+ // Avoid duplicate registration MBean to exporter.
+ coreContext.getBean(MBeanExporter.class).setRegistrationPolicy(RegistrationPolicy.IGNORE_EXISTING);
+ }
+ }
+
+ private static void startWithoutConsole(String[] args) {
+ ConfigurableApplicationContext coreContext = startCoreContext(args);
+ prepareCoreContext(coreContext);
+ ConfigurableApplicationContext webContext = startServerWebContext(args, coreContext);
+ }
+
+ private static void startWithConsole(String[] args) {
+ ConfigurableApplicationContext coreContext = startCoreContext(args);
+ prepareCoreContext(coreContext);
+ ConfigurableApplicationContext serverWebContext = startServerWebContext(args, coreContext);
+ ConfigurableApplicationContext consoleContext = startConsoleContext(args, coreContext);
+ }
+
+ private static ConfigurableApplicationContext startCoreContext(String[] args) {
+ NacosStartUpManager.start(NacosStartUp.CORE_START_UP_PHASE);
+ return new SpringApplicationBuilder(NacosServerBasicApplication.class).web(WebApplicationType.NONE)
+ .banner(getBanner("core-banner.txt")).run(args);
+ }
+
+ private static ConfigurableApplicationContext startServerWebContext(String[] args,
+ ConfigurableApplicationContext coreContext) {
+ NacosStartUpManager.start(NacosStartUp.WEB_START_UP_PHASE);
+ return new SpringApplicationBuilder(NacosServerWebApplication.class).parent(coreContext)
+ .banner(getBanner("nacos-server-web-banner.txt")).run(args);
+ }
+
+ private static ConfigurableApplicationContext startConsoleContext(String[] args,
+ ConfigurableApplicationContext coreContext) {
+ NacosStartUpManager.start(NacosStartUp.CONSOLE_START_UP_PHASE);
+ return new SpringApplicationBuilder(NacosConsole.class).parent(coreContext)
+ .banner(getBanner("nacos-console-banner.txt")).run(args);
+ }
+
+ private static void startOnlyConsole(String[] args) {
+ NacosStartUpManager.start(NacosStartUp.CONSOLE_START_UP_PHASE);
+ ConfigurableApplicationContext consoleContext = new SpringApplicationBuilder(NacosConsole.class).banner(
+ getBanner("nacos-console-banner.txt")).run(args);
+ }
+
+ private static Banner getBanner(String bannerFileName) {
+ return new ResourceBanner(new ClassPathResource(bannerFileName));
+ }
+}
\ No newline at end of file
diff --git a/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConfigConstants.java b/pigx-register/src/main/java/com/alibaba/nacos/bootstrap/config/ConfigConstants.java
similarity index 69%
rename from pigx-register/src/main/java/com/alibaba/nacos/console/config/ConfigConstants.java
rename to pigx-register/src/main/java/com/alibaba/nacos/bootstrap/config/ConfigConstants.java
index 00c332deb..c1c97a9fd 100644
--- a/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConfigConstants.java
+++ b/pigx-register/src/main/java/com/alibaba/nacos/bootstrap/config/ConfigConstants.java
@@ -15,7 +15,7 @@
* Author: lengleng (wangiegie@gmail.com)
*/
-package com.alibaba.nacos.console.config;
+package com.alibaba.nacos.bootstrap.config;
/**
* @author lengleng
@@ -26,28 +26,13 @@ package com.alibaba.nacos.console.config;
public interface ConfigConstants {
/**
- * The System property name of Standalone mode
+ * 独立模式系统属性名称
*/
String STANDALONE_MODE = "nacos.standalone";
/**
- * 是否开启认证
+ * Nacos控制台端口号配置键
*/
- String AUTH_ENABLED = "nacos.core.auth.enabled";
-
- /**
- * 日志目录
- */
- String LOG_BASEDIR = "server.tomcat.basedir";
-
- /**
- * access_log日志开关
- */
- String LOG_ENABLED = "server.tomcat.accesslog.enabled";
-
- /**
- * 路径 nacos context path
- */
- String NACOS_CONTEXT_PATH = "server.servlet.contextPath";
+ String NACOS_CONSOLE_PORT = "nacos.console.port";
}
diff --git a/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConsoleConfig.java b/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConsoleConfig.java
deleted file mode 100644
index 34426de8c..000000000
--- a/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConsoleConfig.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.nacos.console.config;
-
-import com.alibaba.nacos.console.filter.XssFilter;
-import com.alibaba.nacos.core.code.ControllerMethodsCache;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.stereotype.Component;
-import org.springframework.web.cors.CorsConfiguration;
-import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
-import org.springframework.web.filter.CorsFilter;
-
-import javax.annotation.PostConstruct;
-import java.time.ZoneId;
-
-/**
- * Console config.
- *
- * @author yshen
- * @author nkorange
- * @since 1.2.0
- */
-@Component
-@EnableScheduling
-@PropertySource("/application.yml")
-public class ConsoleConfig {
-
- @Autowired
- private ControllerMethodsCache methodsCache;
-
- @Value("${nacos.console.ui.enabled:true}")
- private boolean consoleUiEnabled;
-
- /**
- * Init.
- */
- @PostConstruct
- public void init() {
- methodsCache.initClassMethod("com.alibaba.nacos.core.controller");
- methodsCache.initClassMethod("com.alibaba.nacos.naming.controllers");
- methodsCache.initClassMethod("com.alibaba.nacos.config.server.controller");
- methodsCache.initClassMethod("com.alibaba.nacos.console.controller");
- }
-
- @Bean
- public CorsFilter corsFilter() {
- CorsConfiguration config = new CorsConfiguration();
- config.setAllowCredentials(true);
- config.addAllowedHeader("*");
- config.setMaxAge(18000L);
- config.addAllowedMethod("*");
- config.addAllowedOriginPattern("*");
- UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
- source.registerCorsConfiguration("/**", config);
- return new CorsFilter(source);
- }
-
- @Bean
- public XssFilter xssFilter() {
- return new XssFilter();
- }
-
- @Bean
- public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization() {
- return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(ZoneId.systemDefault().toString());
- }
-
- public boolean isConsoleUiEnabled() {
- return consoleUiEnabled;
- }
-
-}
diff --git a/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConsoleModuleStateBuilder.java b/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConsoleModuleStateBuilder.java
deleted file mode 100644
index 68b5c039c..000000000
--- a/pigx-register/src/main/java/com/alibaba/nacos/console/config/ConsoleModuleStateBuilder.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 1999-2023 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.nacos.console.config;
-
-import com.alibaba.nacos.sys.module.ModuleState;
-import com.alibaba.nacos.sys.module.ModuleStateBuilder;
-import com.alibaba.nacos.sys.utils.ApplicationUtils;
-
-/**
- * Console module state builder.
- *
- * @author xiweng.yy
- */
-public class ConsoleModuleStateBuilder implements ModuleStateBuilder {
-
- public static final String CONSOLE_MODULE = "console";
-
- private static final String CONSOLE_UI_ENABLED = "console_ui_enabled";
-
- @Override
- public ModuleState build() {
- ModuleState result = new ModuleState(CONSOLE_MODULE);
- try {
- ConsoleConfig consoleConfig = ApplicationUtils.getBean(ConsoleConfig.class);
- result.newState(CONSOLE_UI_ENABLED, consoleConfig.isConsoleUiEnabled());
- }
- catch (Exception ignored) {
- }
- return result;
- }
-
-}
diff --git a/pigx-register/src/main/java/com/alibaba/nacos/console/controller/HealthController.java b/pigx-register/src/main/java/com/alibaba/nacos/console/controller/HealthController.java
deleted file mode 100644
index 00be63787..000000000
--- a/pigx-register/src/main/java/com/alibaba/nacos/console/controller/HealthController.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.nacos.console.controller;
-
-import com.alibaba.nacos.console.paramcheck.ConsoleDefaultHttpParamExtractor;
-import com.alibaba.nacos.core.cluster.health.ModuleHealthCheckerHolder;
-import com.alibaba.nacos.core.cluster.health.ReadinessResult;
-import com.alibaba.nacos.core.paramcheck.ExtractorManager;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * Health Controller.
- *
- * @author hxy1991
- */
-@RestController("consoleHealth")
-@RequestMapping("/v1/console/health")
-@ExtractorManager.Extractor(httpExtractor = ConsoleDefaultHttpParamExtractor.class)
-public class HealthController {
-
- /**
- * Whether the Nacos is in broken states or not, and cannot recover except by being
- * restarted.
- * @return HTTP code equal to 200 indicates that Nacos is in right states. HTTP code
- * equal to 500 indicates that Nacos is in broken states.
- */
- @GetMapping("/liveness")
- public ResponseEntity liveness() {
- return ResponseEntity.ok().body("OK");
- }
-
- /**
- * Ready to receive the request or not.
- * @return HTTP code equal to 200 indicates that Nacos is ready. HTTP code equal to
- * 500 indicates that Nacos is not ready.
- */
- @GetMapping("/readiness")
- public ResponseEntity readiness(HttpServletRequest request) {
- ReadinessResult result = ModuleHealthCheckerHolder.getInstance().checkReadiness();
- if (result.isSuccess()) {
- return ResponseEntity.ok().body("OK");
- }
- return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(result.getResultMessage());
- }
-
-}
diff --git a/pigx-register/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java b/pigx-register/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java
deleted file mode 100644
index 99181d79b..000000000
--- a/pigx-register/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.nacos.console.controller;
-
-import com.alibaba.nacos.api.exception.NacosException;
-import com.alibaba.nacos.auth.annotation.Secured;
-import com.alibaba.nacos.common.model.RestResult;
-import com.alibaba.nacos.common.model.RestResultUtils;
-import com.alibaba.nacos.common.utils.StringUtils;
-import com.alibaba.nacos.console.paramcheck.ConsoleDefaultHttpParamExtractor;
-import com.alibaba.nacos.core.namespace.repository.NamespacePersistService;
-import com.alibaba.nacos.core.namespace.model.Namespace;
-import com.alibaba.nacos.core.paramcheck.ExtractorManager;
-import com.alibaba.nacos.core.service.NamespaceOperationService;
-import com.alibaba.nacos.plugin.auth.constant.ActionTypes;
-import com.alibaba.nacos.plugin.auth.impl.constant.AuthConstants;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-import java.util.UUID;
-import java.util.regex.Pattern;
-
-/**
- * namespace service.
- *
- * @author Nacos
- */
-@RestController
-@RequestMapping("/v1/console/namespaces")
-@ExtractorManager.Extractor(httpExtractor = ConsoleDefaultHttpParamExtractor.class)
-public class NamespaceController {
-
- @Autowired
- private NamespacePersistService namespacePersistService;
-
- @Autowired
- private NamespaceOperationService namespaceOperationService;
-
- private final Pattern namespaceIdCheckPattern = Pattern.compile("^[\\w-]+");
-
- private final Pattern namespaceNameCheckPattern = Pattern.compile("^[^@#$%^&*]+$");
-
- private static final int NAMESPACE_ID_MAX_LENGTH = 128;
-
- /**
- * Get namespace list.
- * @return namespace list
- */
- @GetMapping
- public RestResult> getNamespaces() {
- return RestResultUtils.success(namespaceOperationService.getNamespaceList());
- }
-
- /**
- * get namespace all info by namespace id.
- * @param namespaceId namespaceId
- * @return namespace all info
- */
- @GetMapping(params = "show=all")
- public Namespace getNamespace(@RequestParam("namespaceId") String namespaceId) throws NacosException {
- return namespaceOperationService.getNamespace(namespaceId);
- }
-
- /**
- * create namespace.
- * @param namespaceName namespace Name
- * @param namespaceDesc namespace Desc
- * @return whether create ok
- */
- @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;
- }
- }
-
- /**
- * check namespaceId exist.
- * @param namespaceId namespace id
- * @return true if exist, otherwise false
- */
- @GetMapping(params = "checkNamespaceIdExist=true")
- public Boolean checkNamespaceIdExist(@RequestParam("customNamespaceId") String namespaceId) {
- if (StringUtils.isBlank(namespaceId)) {
- return false;
- }
- return (namespacePersistService.tenantInfoCountByTenantId(namespaceId) > 0);
- }
-
- /**
- * edit namespace.
- * @param namespace namespace
- * @param namespaceShowName namespace ShowName
- * @param namespaceDesc namespace Desc
- * @return whether edit ok
- */
- @PutMapping
- @Secured(resource = AuthConstants.CONSOLE_RESOURCE_NAME_PREFIX + "namespaces", action = ActionTypes.WRITE)
- public Boolean editNamespace(@RequestParam("namespace") String namespace,
- @RequestParam("namespaceShowName") String namespaceShowName,
- @RequestParam(value = "namespaceDesc", required = false) String namespaceDesc) {
- // contains illegal chars
- if (!namespaceNameCheckPattern.matcher(namespaceShowName).matches()) {
- return false;
- }
- return namespaceOperationService.editNamespace(namespace, namespaceShowName, namespaceDesc);
- }
-
- /**
- * del namespace by id.
- * @param namespaceId namespace Id
- * @return whether del ok
- */
- @DeleteMapping
- @Secured(resource = AuthConstants.CONSOLE_RESOURCE_NAME_PREFIX + "namespaces", action = ActionTypes.WRITE)
- public Boolean deleteNamespace(@RequestParam("namespaceId") String namespaceId) {
- return namespaceOperationService.removeNamespace(namespaceId);
- }
-
-}
diff --git a/pigx-register/src/main/java/com/alibaba/nacos/console/controller/ServerStateController.java b/pigx-register/src/main/java/com/alibaba/nacos/console/controller/ServerStateController.java
deleted file mode 100644
index b9211f4a2..000000000
--- a/pigx-register/src/main/java/com/alibaba/nacos/console/controller/ServerStateController.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.alibaba.nacos.console.controller;
-
-import com.alibaba.nacos.common.model.RestResult;
-import com.alibaba.nacos.common.model.RestResultUtils;
-import com.alibaba.nacos.console.paramcheck.ConsoleDefaultHttpParamExtractor;
-import com.alibaba.nacos.core.paramcheck.ExtractorManager;
-import com.alibaba.nacos.sys.env.EnvUtil;
-import com.alibaba.nacos.sys.module.ModuleState;
-import com.alibaba.nacos.sys.module.ModuleStateHolder;
-import com.alibaba.nacos.sys.utils.DiskUtils;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-import static com.alibaba.nacos.common.utils.StringUtils.FOLDER_SEPARATOR;
-import static com.alibaba.nacos.common.utils.StringUtils.TOP_PATH;
-import static com.alibaba.nacos.common.utils.StringUtils.WINDOWS_FOLDER_SEPARATOR;
-
-/**
- * Server state controller.
- *
- * @author xingxuechao on:2019/2/27 11:17 AM
- */
-@RestController
-@RequestMapping("/v1/console/server")
-@ExtractorManager.Extractor(httpExtractor = ConsoleDefaultHttpParamExtractor.class)
-public class ServerStateController {
-
- private static final String ANNOUNCEMENT_FILE = "announcement.conf";
-
- private static final String GUIDE_FILE = "console-guide.conf";
-
- /**
- * Get server state of current server.
- * @return state json.
- */
- @GetMapping("/state")
- public ResponseEntity