分页插件PageHelper踩坑
摘要:1.业务代码 @GetMapping("/list") public TableDataInfo list(JsnhRoomCategoriesSearch search) { try { startPage(); if(StringUtils.isEmpty(search.getDeleted()
阅读全文
防止重复提交
摘要:指定对某些请求进行重复提交校验。避免同一客户在指定时间内重复提交同样的请求(参数一样)。 采用的方式:注解+拦截器+REDIS 1.自定义注解 @Inherited @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Do
阅读全文
springboot FilterRegistrationBean 拦截器的使用
摘要:1.创建一个filter package com.ruoyi.weixin.user.interator; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import c
阅读全文
springboot多模块controller访问的问题
摘要:参考 https://blog.csdn.net/qq_25091649/article/details/88429512 情况一:在主类直接写controller接口,能够访问到 @SpringBootApplication @RestController public class DemoApp
阅读全文
spring security登录认证流程解析
摘要:转 https://blog.csdn.net/qq_37142346/article/details/80032336 1.说明 用户认证流程 认证结果如何在多个请求之间共享 获取认证用户信息、用户认证流程 Spring Security核心就是一系列的过滤器链,当一个请求来的时候,首先要通过过滤
阅读全文
springboot动态管理定时任务
摘要:1.表 job任务表 CREATE TABLE `sys_job` ( `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务ID', `job_name` varchar(64) NOT NULL DEFAULT '' COMMENT '任务
阅读全文
JoinPoint
摘要:import org.aspectj.lang.reflect.SourceLocation; public interface JoinPoint { String toString(); //连接点所在位置的相关信息 String toShortString(); //连接点所在位置的简短相关信
阅读全文
多数据源
摘要:1.配置文件 # 数据源配置 spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver druid: # 主库数据源 master: url:
阅读全文
@RestControllerAdvice全局异常统一处理
摘要:spring项目中,我们通常规定了返回的格式(成功-失败-异常),特别是异常怎么处理方便呢? 1.自定义状态码实体 package com.ruoyi.common.constant; /** * 返回状态码 * * @author ruoyi */ public class HttpStatus
阅读全文
spring的事务传播机制
摘要:事务在多个方法的调用中是如何传递的,比如一个service方法调用另外一个service方法,事务是怎么创建,父方法的回滚对子方法的事务是否有影响?这些都是可以通过事务传播机制来决定的 Transactional注解的常用属性表: 属性说明 propagation 事务的传播行为,默认值为 REQU
阅读全文