![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot
文章平均质量分 50
恋曦Tel
成为更好的自己。
展开
-
通用Result<T>公共响应结果对象设计
通用公共Result<T>响应结果对象设计原创 2022-01-24 18:23:37 · 2613 阅读 · 0 评论 -
对Mybatis-Plus的封装(更新中)
对Mybatis-Plus的封装(更新中)在日常实际业务开发中常常对非必传参数组装查询条件,一大堆if判断充斥在我们的代码中,我们可以做一层封装简化业务代码:protected <C, R> void eqNon(AbstractWrapper<C, R, ?> wrapper, R column, Object value) { if (Objects.isNull(value)) { return; } wrapper.eq(column原创 2021-11-14 19:30:23 · 1461 阅读 · 0 评论 -
读取项目Resources资源目录下文件的方式
Spring下读取项目Resources资源目录下文件的方式尝试了很多读取resource资源文件的方式,很多读取不到或者是读取配置文件的形式。以下两种方式,方式一用于通过启动jar方式时读取,方式二是本地IDE启动时读取。import org.springframework.core.io.ClassPathResource;import org.springframework.util.ResourceUtils;/** * 读取resources文件 * @param xmlPath原创 2021-10-21 19:55:26 · 1164 阅读 · 0 评论 -
IDEA中搜索项目jar包里的日志、代码等内容
IDEA中搜索项目jar包里的日志、代码等内容启动项目时,有时候我们想通过启动日志来查看源码了解代码执行的流程,或者是项目启动失败了,想通过打印出的日志定位源码位置来了解失败的原因,但是Windows下在IDEA中直接Ctrl+Shift+F或双击Shift直接搜索是搜索不到jar包里面的内容的。解决方式:通过Ctrl+Shift+F然后切换到Directory选项就能搜索到了。网上有说通过下载jar包源码去搜索,试了下没有搜到,这种方式应该是可以搜到的,但是下载源码搜索感觉很不爽,那么多类也不知原创 2021-06-11 10:46:35 · 2348 阅读 · 0 评论 -
SpringBoot启动失败报错,spring.profiles.active:@env@中环境变量@无法识别报错
今天开发中碰到的问题,报错内容如下:Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next tokenfound character '@' that cannot start any token. (Do not use @ for indentation) in 'reader', line 3, column 13: active: @env@原创 2021-01-15 18:52:59 · 17923 阅读 · 0 评论 -
Maven项目引用本地jar包依赖打包警告should not point at files within the project directory
Maven项目引用本地jar包依赖打包警告Some problems were encountered while building the effective model for com.xxx.xxx:xxx-xxx:jar should not point at files within the project directorySome problems were encountered while building the effective model for com.xxx.xxx:xxx-原创 2021-01-14 19:00:24 · 12669 阅读 · 0 评论 -
通俗学习Mockito结合Spring跨多层接口mock测试方法
A调B,B调C,测试A,mock掉C场景: 想要测试ServiceA下的getUserVo()方法,getUserVo()方法调用了ServiceB的服务,ServiceB里又调用了ServiceC的getUser()方法,需要mock掉ServiceC的getUser()方法。操作方法: 详细如代码,参照代码注释①把需要mock注入的服务(ServiceA,ServiceB)加上 @Inj...原创 2019-01-31 16:06:50 · 9655 阅读 · 4 评论