- 博客(7)
- 收藏
- 关注
原创 自定义注解配合使用ResponseBodyAdvice对返回数据进行二次封装
1、定义自定义注解@Target({ElementType.METHOD, ElementType.TYPE})@Retention(RetentionPolicy.RUNTIME)@Documentedpublic @interface CheckEncrypt {}2、在方法上加入该注解后,认定为该方法的返回值需要进行加密3、使用ResponseBodyAdvice进行二次加密@Slf4j@RestControllerAdvicepublic class EncryptRespon
2021-09-29 09:15:10
570
原创 SpringBoot拦截器使用实例
1、编写拦截器类,实现Spring的HandlerInterceptor接口@Slf4jpublic class MyInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { StringB
2021-09-28 10:07:36
189
原创 redis监听过期key整合SpringBoot
1、redis监听 1、部署redis,引入依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId></dependency> 2、配置文件配置redisspring.redis.host=localhostspring.redis.port
2021-09-27 16:09:57
161
转载 sentinel本地规则持久化
<!--springboot 整合 sentinel框架--><dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-alibaba-sentinel</artifactId> <version>0.9.0.RELEASE</version></dependency>
2021-09-11 15:07:55
393
原创 配置网关以及解决跨域问题
配置网关以及解决跨域问题 1、首先在前端页面,把基础请求路由给网关 // api接口请求地址 window.SITE_CONFIG['baseUrl'] = 'http://localhost:88/api'; 2、在网关中首先引入依赖 <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-c
2021-01-04 16:47:49
767
1
原创 整合Mybatis-Plus的具体步骤
1、导入依赖 <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.2.0</version> </dependency>2、配置1)、配置数据源1、导入m
2021-01-03 16:47:04
202
原创 Linux基本操作指令与shell的入门
1、Linux的共享文件夹 共享文件夹默认在mnt->hgfs文件夹下2、Linux的目录结构 Linux下一切皆文件 / 根目录,只有一个根目录,不像windows有c盘d盘等等 /bin 存放最经常使用的命令,例如拷贝删除等等 /sbin 存放的是系统管理员使用的系统管理程序 /home 存放普通用户的主目录,在Linux中每个用户都有一个自己的目录,一般该目录是以用户的账户命名的 /root 该目录为系统管理员,也称作超级权限者的用户主目录 /l
2020-10-06 19:49:03
677
2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人