摘要: package com.imooc.mall.exception; /** * 描述: 统一异常 */ public class ImoocMallException extends RuntimeException { private final Integer code; private fin 阅读全文
posted @ 2021-05-19 16:36 little_mao 阅读(68) 评论(0) 推荐(0) 编辑
摘要: ###泛型类 package com.imooc.mall.common; import com.imooc.mall.exception.ImoocMallExceptionEnum; /** * 描述: 通用返回对象 * 泛型类 */ public class ApiRestResponse<T 阅读全文
posted @ 2021-05-19 16:05 little_mao 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1.添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> 2.定义切面类,实现web层的日志切面 要想把 阅读全文
posted @ 2021-05-19 10:53 little_mao 阅读(65) 评论(0) 推荐(0) 编辑
摘要: RequestContextHolder ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletRequest 阅读全文
posted @ 2021-05-19 10:41 little_mao 阅读(72) 评论(0) 推荐(0) 编辑
摘要: ###springboot项目添加log4j2日志组件 1,排除logback日志组件,加入新的log4j2日志组件,防止多个组件之间发生冲突 dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boo 阅读全文
posted @ 2021-05-19 00:18 little_mao 阅读(2011) 评论(0) 推荐(0) 编辑