refactor(): 简化应用配置类并移除废弃代码

dev
lishiwei 2026-07-10 14:06:45 +08:00
parent 22ec272ecf
commit c044c6fd81
2 changed files with 1 additions and 65 deletions

View File

@ -12,25 +12,9 @@ import org.springframework.boot.SpringApplication;
scanBasePackages = {"com.zcloud","com.jjb"}, scanBasePackages = {"com.zcloud","com.jjb"},
mapperPackages = {"com.zcloud.*.persistence.mapper"} mapperPackages = {"com.zcloud.*.persistence.mapper"}
) )
//@EnableGatewayServer
//@EnableFacadeRpcClient
public class Application { public class Application {
public static void main(String[] args) throws NacosException { public static void main(String[] args) {
// NacosConfigProperties nacosConfigProperties = new NacosConfigProperties();
// nacosConfigProperties.setServerAddr("gbs-nacos.qhdsafety.com");
// nacosConfigProperties.setNamespace("jjb-dragon");
// String serverAddr = "{serverAddr}";
// Properties properties = new Properties();
// properties.put("serverAddr", serverAddr);
//
// // if need username and password to login
// properties.put("username","${username}");
// properties.put("password","${password}");
//
// ConfigService configService = NacosFactory.createMaintainService(properties);
// NamingService configService = NacosFactory.createNamingService(properties);
// com.zcloud.gbscommon.utils.DateUtil dateUtil = new DateUtil();
SpringApplication.run(Application.class, args); SpringApplication.run(Application.class, args);
} }
} }

View File

@ -1,48 +0,0 @@
package com.zcloud.zcGbsServicer;
import com.jjb.saas.framework.auth.config.EnableAuthClient;
import com.jjb.saas.framework.feign.annotation.EnableJjbFeignClients;
import com.jjb.saas.gateway.starter.annotation.EnableGatewayServer;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.core.annotation.AliasFor;
import org.springframework.jmx.support.RegistrationPolicy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import java.lang.annotation.*;
/**
* @author lin
*/
@Configuration(proxyBeanMethods = true)
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
@EnableAspectJAutoProxy
@EnableDiscoveryClient
@EnableAuthClient
@EnableScheduling
@EnableAsync
@EnableGlobalMethodSecurity(prePostEnabled = true)
@EnableCaching
@EnableJjbFeignClients
@MapperScan
@ComponentScan
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@EnableGatewayServer
@SpringBootApplication
public @interface ZcloudSpringbootApplication {
@AliasFor(annotation = ComponentScan.class, attribute = "basePackages") String[] scanBasePackages() default {"com.jjb"};
@AliasFor(annotation = MapperScan.class, attribute = "basePackages") String[] mapperPackages() default {"com.jjb.*.*.infrastructure.persistence.mapper"};
}