随笔分类 - SpringBoot+Spring
SpringBoot+Spring
摘要:1.引入依赖 <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <depende
阅读全文
摘要:优雅的sprongboot启动类 package fama.cost.server; import fama.cost.common.IStoppable; import fama.cost.common.thread.Stopper; import fama.cost.dao.utils.Bean
阅读全文
摘要:1.application.properties zookeeper.address=@mvn.zookeeper.address@ zookeeper.namespace=@mvn.zookeeper.namespace@ 2.pom.xml中多profile环境不同变量定义 <propertie
阅读全文
摘要:1.添加钩子函数,钩子函数中指定要调用的方法 @PostConstruct public void run() { this.zkClient.start(this); this.schedulerService.start(); try { logger.info("start Quartz se
阅读全文
摘要:发布到线上的包结构 runtime是发布到线上的目录结构 1.项目pom.xml添加打包配置 <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-pl
阅读全文
摘要:1.获取http头对象 // org.springframework.http.HttpHeaders private HttpHeaders getHttpHeaders() { HttpHeaders headers = new HttpHeaders(); headers.setAcceptC
阅读全文
摘要:@SpringBootApplication @ComponentScan(basePackages = {"demo.test"}) public class ReportApplication { private static final Logger logger = LoggerFactor
阅读全文