![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
郭俊强
这个作者很懒,什么都没留下…
展开
-
spring boot 实现token拦截
package com.example.config.request.handler;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.Target;import java.lang.annotation.RetentionPolicy;//Authorization.java,授权注解,作用于controller类及其方法上,方法.原创 2021-12-21 10:06:54 · 1424 阅读 · 0 评论 -
spring boot 请求数据加密解密
package com.example.config.request.resulet;import com.example.config.exception.handler.BusinessException;import com.example.config.response.enums.ResultCode;import lombok.extern.slf4j.Slf4j;import org.springframework.core.MethodParameter;import org.s.原创 2021-12-20 16:01:08 · 1254 阅读 · 0 评论 -
spring boot 定时任务
启动类上添加@EnableScheduling注解@EnableScheduling@SpringBootApplicationpublic class StartApplication { public static void main(String[] args) { SpringApplication.run(StartApplication.class, args); }}然后想要使用定时器的方法上加入@Scheduled(initialDelay原创 2021-12-19 19:32:24 · 115 阅读 · 0 评论 -
spring boot 异步async
#### 步骤1:配置线程池```@Configuration@EnableAsyncpublic class SyncConfiguration { @Bean("setOrderInfo") public ThreadPoolTaskExecutor getScorePoolTaskExecutor() { ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor(); //.原创 2021-12-18 20:24:33 · 249 阅读 · 0 评论 -
springboot日志框架logback
springboot常用的日志框架: logback、log4j原创 2021-12-18 16:35:36 · 882 阅读 · 0 评论 -
springboot 多模块
新建项目:新建好的项目呢,咱们把多余的删掉,没有什么用处了,新建的作为父容器然后开始新建两个Module,一个为start(启动类),一个为infoinfo也如上图一样建立就可以了然后在父级模块(根目录)下的pom中引入两个模块然后呢将两个模块的pom.xml中的parent改为父工程中的数据(groupId、artifactId、version),将父级的三个值复制过来即可,info模块也如下图所示然后start下的pom.xml中将inf..原创 2021-12-18 13:37:09 · 3799 阅读 · 3 评论 -
springboot动态端口
固定端口: server: port: 8090随机端口: server: port: ${random.int[1024,9999]}原创 2021-12-16 16:19:48 · 988 阅读 · 0 评论 -
spring boot 多环境配置
applicatiion.yml中的profiles.active指向的为当前环境原创 2021-12-13 15:19:13 · 171 阅读 · 0 评论 -
spring boot 支持跨域配置
新建java类:复制下面即可、注意包名和类名package com.example.start.CORSConfig;import org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.config.annotation.CorsRegistry;import org.springframework.web.servlet.config.annotation.Web原创 2021-12-13 15:14:30 · 141 阅读 · 0 评论 -
Springboot整合log4j2
Springboot整合原创 2021-12-02 15:14:06 · 126 阅读 · 0 评论