- 博客(21)
- 问答 (1)
- 收藏
- 关注
原创 stream流分组比较字段大小并取较大值
userList.parallelStream().collect(Collectors.groupingBy(User::getAge, Collectors.collectingAndThen(Collectors.reducing((c1, c2) -> c1.getAge().compareTo(c2.getAge()) > 0 ? c1 : c2), Optional::get)));
2021-08-19 09:39:00
2345
原创 springbbot的logback.xml
<?xml version="1.0" encoding="UTF-8"?><configuration> <!--修改1:<fileNamePattern>logs/自己的模块名/%d{yyyy-MM-dd}.log</fileNamePattern>--> <!--修改2:<logger name="扫描的包的路径" level="debug">--> <!-- 输出到控制台 --&.
2021-05-15 12:47:20
329
原创 IDEA 创建新分支修复bug,合并代码
前言:在实际开发中,git一般会有dev分支和master分支。dev用于开发新的需求,开发完之后合并到master分支上。但是经常遇到线上需要紧急修复线上bug,当前dev分支中有开发到一半的需求,又不能在dev上进行修复。此时应该如何操作呢?以下全部都是基于idea中操作第一步:commit and push 【dev分支】的代码。第二步:基于【master分支】创建【bugfix分支】。第三步:在【bugfix分支】上修复bug,并commit and push
2021-01-28 16:29:48
833
原创 DNS校验,SSL证书校验
import cn.hutool.core.util.StrUtil;import cn.hutool.crypto.asymmetric.KeyType;import cn.hutool.crypto.asymmetric.RSA;import cn.hutool.http.HttpUtil;import com.faraway.pdemo.exception.DefinedException;import lombok.extern.slf4j.Slf4j;import org.bounc.
2020-11-18 12:38:17
1111
原创 OpenFeign超时时长设置及详解
概念明确:1. hystrix可配置的部分:hystrix.command.default.execution.timeout.enable=true //为false则超时控制有ribbon控制,为true则hystrix超时和ribbon超时都是用,但是谁小谁生效,默认为true hystrix.command.default.execution.isolation.thread....
2020-05-04 17:00:42
7084
原创 微服务devtools实现热部署
https://jingyan.baidu.com/article/870c6fc367b4d7b03fe4beba.html
2020-04-28 10:30:54
358
原创 mysql自动维护create_time和update_time
CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nickname` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户昵称', `email` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NUL...
2019-11-05 16:28:20
671
原创 WxJava微信p12错误问题
如图所示:这个时候文件正常加载进去了,但是此时坑来了,程序运行时报错 原因:maven打包时,会对文件进行转码,重新编码后会导致证书文件不可用 解决:poom依赖中进行配置,让maven打包时过滤掉不需要转码的文件 具体如下:<!--处理资源文件插件,默认的资源文件在src/main/resources目录下,可以实现filter--> ...
2019-09-06 13:49:18
797
原创 idea中web项目新增模块,右侧maven管理中显示灰色解决办法
在settings中搜索maven,点击Ignored Files,去掉灰色的那个模块的勾选状态
2019-08-13 13:40:46
2984
原创 SpringBoot 404、500错误提示页面
SpringBoot 404、500错误提示页面一. 在使用ThymeLeaf模板时,SpringBoot会自动到src/main/resources/templates/error/文件夹下寻找404.html、500.html的错误提示页面。错误提示页面的命名规则就是:错误码.html,如404是404.html,500是500.html。二. 如果没有使用ThymeLeaf模板...
2019-08-03 06:59:40
933
原创 关于springboot返回时间相差8小时的问题研究
url使用serverTimezone=UTC,最终返回的时间和数据库时间一样,外表看起来没有错,但是实际在整个逻辑流转中时间都是以多8小时存在。即:读取的时间是错的,比数据库多8小时,返回的时间又是对的,与数据库一样。原因:指定url为UTC时区去数据库查时间,返回时间会在数据库记录中当前时间的基础上加上系统时区时间(mysql时区默认是系统时区),即n+8。但是@Response...
2019-07-25 14:35:04
4440
原创 Closing non transactional SqlSession导致spring事务不生效
记一次找了一天的bug!!!!spring版本5.1.8.RELEASE错误:Closing non transactional SqlSession!父子容器扫描重复问题网上看了很多解决办法,主流的解决办法是:1.在applicationContext.xml中配置不扫描controller注解:<context:component-scan base-package="...
2019-07-02 19:41:09
17997
原创 对于二进制原码反码和补码的理解
XXXX XXXX 第一位是符号位,0代表正数,1代表负数。正数的原码,反码,补码一样。例如 3 的原码是:0000 0011;反码也是:0000 0011;补码还是:0000 0011。负数的原码,反码,补码不一样。所以引入反码和补码的概念完全是为了负数。因为计算机中没有减法,只有加法。例如 -2 的原码是:1000 0010;反码是除了符号位全部取反:1111 1101;...
2019-05-22 12:26:57
982
原创 SpringCloud使用Sentinel 代替 Hystrix
本文基于springboot-2.0.6RELEASE+cloud-F.SR2Feign环境下:只需两步1.在原使用hystrix的模块中添加如下依赖:<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-al...
2019-01-30 11:40:54
3674
原创 CentOS7打开关闭防火墙与端口
1.firewalld的基本使用启动: systemctl start firewalld关闭: systemctl stop firewalld查看状态: systemctl status firewalld 开机禁用 : systemctl disable firewalld开机启用 : systemctl enable firewalld2.systemctl是C...
2018-12-26 15:59:07
234
原创 CentOS7卸载安装初始化mariadb
卸载Mariadb:1.查询所安装的MariaDB组件[root@localhost logs]# rpm -qa | grep maria*mariaDB-server-5.5.49-1.el7.centos.x86_64mariaDB-common-5.5.49-1.el7.centos.x86_64mariaDB-client-5.5.49-1.el7.centos.x86_6...
2018-12-26 15:33:20
509
原创 mysql分组查询,且查询每组最新的一条数据
select a.* from product as a,(select max(create_time) as create_time from product group by type) as bwhere a.create_time=b.create_timegroup by a.typeorder by a.create_time desc;或者select a.* fr...
2018-12-14 10:38:26
7150
4
空空如也
mysql中如何使用row_number(),例如查询每个班成绩前三名?
2017-10-14
TA创建的收藏夹 TA关注的收藏夹
TA关注的人