SpringBoot2.X整合ClickHouse项目实战-从零搭建整合(三)
一、ClickHouse+SpringBoot2.X+MybatisPlus整合搭建
二、需求描述和数据库准备
三、ClickHouse统计SQL编写实战和函数使用
四、ClickHouse+SpringBoot2.X案例-基础模块搭建
controller/request层
mapper层
model层
service层
五、ClickHouse+SpringBoot2.X案例-数据统计接口
service层
mapper层
一、ClickHouse+SpringBoot2.X+MybatisPlus整合搭建
1.在线创建项目 https://start.spring.io/
idea导入刚下载下来的项目
在pom.xml中增加ClickHouse依赖
<dependency><groupId>ru.yandex.clickhouse</groupId><artifactId>clickhouse-jdbc</artifactId><version>0.1.55</version></dependency><!--mybatis plus--><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.4.0</version></dependency>
数据库连接配置
server.port=8080
spring.datasource.driver-class-name=ru.yandex.clickhouse.ClickHouseDriver
spring.datasource.url=jdbc:clickhouse://11x.xxx.xx.24x:8123/default
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
logging.level.root=INFO
二、需求描述和数据库准备
指定商品,统计指定日期范围内,各个省市的访问的pv数量,如7天内有各个城市访问某个商品分布
指定商品,多天内的访问曲线变化图,如,1~7号商品访问量波动图
建表语句:
CREATE TABLE default.visit_stats
(`product_id` UInt64,//商品id`is_new` UInt16,//是否是新用户 1新用户 0老用户`province` String,//省名称`city` String,//市名称`pv` UInt32,//轻度聚合后的访问量`visit_time` DateTime //访问时间
)
ENGINE = MergeTree()
PARTITION BY toYYYYMMDD(visit_time)
ORDER BY (product_id,is_new,province,city);
插入sql:
INSERT into visit_stats values
('1','1','广东','广州',14323,'2023-01-01 12:11:13'),
('1','0','广东','广州',4232,'2023-02-12 16:16:13'),
('1','1','广东','佛山',54323,'2023-03-06 16:11:13'),
('1','0','广东','东莞',42341,'2023-03-02 16:12:13'),
('1','1','广东','梅州',52422,'2023-03-09 12:11:13'),
('2','1','广东','广州',14323,'2021-03-01 12:11:13'),
('2','0','广东','深圳',425232,'2023-04-12 16:16:13'),
('2','1','广东','佛山',543323,'2022-06-06 16:11:13'),
('2','0','广东','东莞',42341,'2021-05-02 16:12:13'),
('2','1','广东','梅州',52422,'2022-01-09 12:11:13'),
('3','1','北京','北京',13132,'2023-01-01 12:11:13'),
('3','0','广东','广州',533232,'2022-02-16 16:16:13'),
('4','1','浙江','杭州',663643,'2023-12-06 12:11:13'),
('4','0','广东','东莞',4142,'2023-11-02 16:12:13'),
('5','1','湖南','长沙',52123,'2022-01-09 12:11:13'),
('4','0','湖南','衡阳',4142,'2024-05-02 16:12:13'),
('5','1','广东','中山',52123,'2024-01-09 12:11:13'),
('2','1','上海','上海',14323,'2021-03-01 12:11:13'),
('5','0','浙江','宁波',425232,'2023-04-12 16:16:13'),
('3','1','广东','佛山',543323,'2022-06-06 16:11:13'),
('2','0','湖南','长沙',42341,'2021-05-02 16:12:13'),
('2','1','广东','深圳',52422,'2022-01-09 12:11:13')
三、ClickHouse统计SQL编写实战和函数使用
统计需求:某个商品再时间范围内地区访问分布-城市级别,天级别
select province,city, sum(pv) pv_count
from visit_stats where product_id =1
and toYYYYMMDD(visit_time) BETWEEN '20200101' and '20241212'
group by province,city order by pv_count desc
函数:
求和:sum(pv)
年格式:select toYear(toDateTime('2024-12-11 11:12:13'))
日期格式化:select toYYYYMMDD(toDateTime('2024-12-11 11:12:13'))
日期时间格式化:select toYYYYMMDDhhmmss(toDateTime('2024-12-11 11:12:13'))
周格式化,1~7,当前时间是本周第几天,下面是周三结果是3,周日结果是7
select toDayOfWeek(toDateTime('2024-12-11 11:12:13'))小时格式化,提取时间里面的小时,比如 2023-12-29 10:05:10,格式化后是【10】点
select toHour(toDateTime('2024-12-11 11:12:13'))分钟格式化,提取时间里面的分钟,比如 2023-12-29 10:05:10,格式化后是【5】分钟
select toMinute(toDateTime('2024-12-11 11:12:13'))秒格式化,提取时间里面的秒
select toSecond(toDateTime('2024-12-11 11:12:13'))获取当前日期时间
select now()获取当前日期
select today()
某个商品,多天内的访问曲线图, 天级别
select toYYYYMMDD(visit_time) date_time_str, sum(pv) pv_count from visit_statswhere product_id =2 and toYYYYMMDD(visit_time) BETWEEN '20200101' and '20241212' group by date_time_str ORDER BY date_time_str desc
所用函数:
逻辑判断:
SELECT if(cond, then, else)
例子:SELECT if(1, plus(3, 3), plus(6, 8))如果条件 cond 的计算结果为非零值,则返回表达式 then 的结果,并且跳过表达式 else 的结果
如果 cond 为零或 NULL,则将跳过 then 表达式的结果,并返回 else 表达式的结果字符串拼接(不能双引号):
select concat('我','上班的时候','没有摸鱼~')
最大、最小、平均值:
select max(pv), min(pv), avg(pv) from visit_stats
四、ClickHouse+SpringBoot2.X案例-基础模块搭建
controller/request层
package net.wnnck.demo.controller.request;public class VisitRecordPageRequest {private long productId;private int page;private int size;public long getProductId() {return productId;}public void setProductId(long productId) {this.productId = productId;}public int getPage() {return page;}public void setPage(int page) {this.page = page;}public int getSize() {return size;}public void setSize(int size) {this.size = size;}
}package net.wnnck.demo.controller;import net.wnnck.demo.controller.request.VisitRecordPageRequest;
import net.wnnck.demo.model.JsonData;
import net.wnnck.demo.service.VisitStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import java.util.Map;
@RestController
@RequestMapping("/api/v1/data")
public class DataController {@Autowiredprivate VisitStatsService visitStatsService;@RequestMapping("page")public JsonData queryVisitRecord(@RequestBody VisitRecordPageRequest pageRequest){Map<String, Object> map = visitStatsService.pageVisitRecord(pageRequest);return JsonData.buildSuccess(map);}}
mapper层
package net.wnnck.demo.mapper;import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wnnck.demo.model.VisitStatsDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;import java.util.List;@Mapper
public interface VisitStatsMapper extends BaseMapper<VisitStatsDO> {/*** 统计总条数* @param productId* @return*/int countTotal(@Param("productId") long productId);/*** 分页* @param from* @param size* @return*/List<VisitStatsDO> pageVisitRecord(@Param("productId")Long productId , @Param("from") int from, @Param("size") int size);}resources/mapper/VisitStatsMapper.xml<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wnnck.demo.mapper.VisitStatsMapper"><!-- 通用查询映射结果 --><resultMap id="BaseResultMap" type="net.wnnck.demo.model.VisitStatsDO"><result column="product_id" property="productId"/><result column="is_new" property="isNew"/><result column="province" property="province"/><result column="city" property="city"/><result column="pv" property="pv"/><result column="visit_time" property="visitTime"/></resultMap><!-- 通用查询结果列 --><sql id="Base_Column_List">product_id,is_new,province,city,pv,visit_time</sql><!--统计总条数--><select id="countTotal" resultType="java.lang.Integer">select count(1) from visit_stats where product_id=#{productId}</select><!--分页查找--><select id="pageVisitRecord" resultMap="BaseResultMap">select<include refid="Base_Column_List"/>from visit_stats where product_id=#{productId}order by visit_time desc limit #{from},#{size}</select></mapper>
model层
package net.wnnck.demo.model;public class JsonData {/*** 状态码 0 表示成功*/private Integer code;/*** 数据*/private Object data;/*** 描述*/private String msg;public JsonData(){}public JsonData(Integer code, Object data, String msg) {this.code = code;this.data = data;this.msg = msg;}/*** 成功,不传入数据** @return*/public static JsonData buildSuccess() {return new JsonData(0, null, null);}/*** 成功,传入数据** @param data* @return*/public static JsonData buildSuccess(Object data) {return new JsonData(0, data, null);}/*** 失败,传入描述信息** @param msg* @return*/public static JsonData buildError(String msg) {return new JsonData(-1, null, msg);}/*** 自定义状态码和错误信息** @param code* @param msg* @return*/public static JsonData buildCodeAndMsg(int code, String msg) {return new JsonData(code, null, msg);}public Integer getCode() {return code;}public void setCode(Integer code) {this.code = code;}public Object getData() {return data;}public void setData(Object data) {this.data = data;}public String getMsg() {return msg;}public void setMsg(String msg) {this.msg = msg;}
}package net.wnnck.demo.model;public class VisitStatsDO {/*** 商品*/private Long productId;/*** 访问时间*/private String visitTime;/*** 1是新访客,0是老访客*/private Integer isNew;/*** 访问量*/private Integer pv;/*** 省份*/private String province;/*** 城市*/private String city;/*** ========度量值=========*/private Long pvCount=0L;/*** 时间的字符串映射,天、小时*/private String dateTimeStr;public Long getProductId() {return productId;}public void setProductId(Long productId) {this.productId = productId;}public String getVisitTime() {return visitTime;}public void setVisitTime(String visitTime) {this.visitTime = visitTime;}public Integer getIsNew() {return isNew;}public void setIsNew(Integer isNew) {this.isNew = isNew;}public Integer getPv() {return pv;}public void setPv(Integer pv) {this.pv = pv;}public String getProvince() {return province;}public void setProvince(String province) {this.province = province;}public String getCity() {return city;}public void setCity(String city) {this.city = city;}public Long getPvCount() {return pvCount;}public void setPvCount(Long pvCount) {this.pvCount = pvCount;}public String getDateTimeStr() {return dateTimeStr;}public void setDateTimeStr(String dateTimeStr) {this.dateTimeStr = dateTimeStr;}
}
service层
package net.wnnck.demo.service;import net.wnnck.demo.controller.request.VisitRecordPageRequest;import java.util.Map;public interface VisitStatsService {Map<String,Object> pageVisitRecord(VisitRecordPageRequest pageRequest);
}
package net.wnnck.demo.service.impl;import net.wnnck.demo.controller.request.VisitRecordPageRequest;
import net.wnnck.demo.mapper.VisitStatsMapper;
import net.wnnck.demo.model.VisitStatsDO;
import net.wnnck.demo.service.VisitStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.util.HashMap;
import java.util.List;
import java.util.Map;@Service
public class VisitStatsServiceImpl implements VisitStatsService {@Autowiredprivate VisitStatsMapper visitStatsMapper;@Overridepublic Map<String, Object> pageVisitRecord(VisitRecordPageRequest pageRequest) {Map<String,Object> data = new HashMap<>(3);Long productId = pageRequest.getProductId();int page = pageRequest.getPage();int size = pageRequest.getSize();int count = visitStatsMapper.countTotal(productId);int from = (page -1) * size;List<VisitStatsDO> visitStatsDOS = visitStatsMapper.pageVisitRecord(productId, from, size);data.put("total",count);data.put("current_page",page);data.put("data",visitStatsDOS);/*** 计算总页数*/int totalPage;if(count % size == 0){totalPage = count / size;}else {totalPage = count / size +1 ;}data.put("total_page",totalPage);return data;}
}
启动后可正常访问,表示基础环境已搭建好。 文末有贴代码下载地址~
五、ClickHouse+SpringBoot2.X案例-数据统计接口
第三节的需求sql整合mapper
service层
@Overridepublic List<VisitStatsDO> queryVisitTrend(VisitTrendQueryRequest queryRequest) {Long productId = queryRequest.getProductId();String type = queryRequest.getType();List<VisitStatsDO> list = null;if(type.equalsIgnoreCase("region")){list = visitStatsMapper.queryRegionTrendWithMultiDay(productId,queryRequest.getStartTime(),queryRequest.getEndTime());} else if(type.equalsIgnoreCase("day")){list = visitStatsMapper.queryVisitTrendWithMultiDay(productId,queryRequest.getStartTime(),queryRequest.getEndTime());}return list;}
mapper层
<select id="queryRegionTrendWithMultiDay" resultMap="BaseResultMap">select province ,city, sum(pv) pv_count from visit_stats
where product_id = #{productId} and toYYYYMMDD(visit_time) BETWEEN #{startTime} and #{endTime}
GROUP BY province ,city order by pv_count desc
</select><select id="queryVisitTrendWithMultiDay" resultMap="BaseResultMap">select toYYYYMMDD(visit_time) date_time_str,sum(pv) pv_count from visit_statswhere product_id = #{productId} and toYYYYMMDD(visit_time) BETWEEN #{startTime} and #{endTime}GROUP BY date_time_str order by date_time_str desc</select>
#时间范围内地区访问分布-城市级别
多天内的访问曲线图pv
代码下载地址:
链接:https://pan.baidu.com/s/1g8dHKiZMQIhJTmuCO814hw?pwd=ex2x
提取码:ex2x
ClickHouse快速安装-可视化工具连接-创建第一个ck库表(一)_clickhouse可视化工具_这是王姑娘的微博的博客-CSDN博客OLAP是什么,以及快速安装ClickHouse(容器化部署),CK可视化工具的下载链接使用以及创建第一个CK数据库和表,然后新增数据,浏览3分钟即可快速掌握这些知识https://blog.csdn.net/wnn654321/article/details/125837194ClickHouse常见SQL语法和常见合并数引擎Demo(二)_这是王姑娘的微博的博客-CSDN博客分区是表的分区,把一张表的数据分成N多个区块,分区后的表还是一张表,数据处理还是由自己来完成PARTITION BY,指的是一个表按照某一列数据(比如日期)进行分区,不同分区的数据会写入不同的文件中建表时加入partition概念,可以按照对应的分区字段,允许查询在指定了分区键的条件下,尽可能的少读取数据注意:不是所有的表引擎都可以分区,合并树(MergeTree) 系列的表引擎才支持数据分区,Log系列引擎不支持。...
https://blog.csdn.net/wnn654321/article/details/125920177
相关文章:
SpringBoot2.X整合ClickHouse项目实战-从零搭建整合(三)
一、ClickHouseSpringBoot2.XMybatisPlus整合搭建 二、需求描述和数据库准备 三、ClickHouse统计SQL编写实战和函数使用 四、ClickHouseSpringBoot2.X案例-基础模块搭建 controller/request层 mapper层 model层 service层 五、ClickHouseSpringBoot2.X案例-数据统计接口 …...
![](https://img-blog.csdnimg.cn/505bfdad61e746389519a7d39b6bf99f.gif#pic_center)
学海记录项目测试报告
⭐️前言⭐️ 本篇文章是博主基于学海记录的个人项目所做的测试报告,用于总结运用自动化测试技术,应用于自己的项目。 🍉欢迎点赞 👍 收藏 ⭐留言评论 📝私信必回哟😁 🍉博主将持续更新学习记录…...
![](https://img-blog.csdnimg.cn/9eb661455602407886e00e0eb7465049.png)
【1792. 最大平均通过率】
来源:力扣(LeetCode) 描述: 一所学校里有一些班级,每个班级里有一些学生,现在每个班都会进行一场期末考试。给你一个二维数组 classes ,其中 classes[i] [passi, totali] ,表示你…...
![](https://img-blog.csdnimg.cn/afe1a03db90b4af7b4b4a791c5ea765d.png)
言简意赅+图解 函数传参问题(传值、传地址 500字解决战斗)
1、传值 2、传地址 不论是传值,还是传地址,形参都是对于实参的一份拷贝 下图为按值传递进行交换: 形参left拷贝一块新空间,形参right拷贝一块新空间 下图为按指针传递进行交换 形参left拷贝一块新的空间,形参right…...
![](https://img-blog.csdnimg.cn/9e9f0b65a57440379fb6c96af9d4b90a.png)
UML-时序图以及PlantUML绘制
介绍 时序图(Sequence Diagram),又名序列图、循序图,是一种UML交互图。它通过描述对象之间发送消息的时间顺序显示多个对象之间的动态协作。它可以表示用例的行为顺序,当执行一个用例行为时,其中的每条消息…...
![](https://img-blog.csdnimg.cn/60e0a2a45e5d43b7bc7253a7f945c2b5.png)
【Redis】Redis 有序集合 Zset 操作 ( 简介 | 查询操作 | 增加操作 | 删除操作 | 修改操作 )
文章目录一、有序集合 Zset二、查询操作1、查询 Zset 所有数据2、查询 Zset 所有数据和评分3、查询指定评分范围的 Zset 数据4、查询指定评分范围的 Zset 数据并从大到小排序5、统计指定评分范围的 Zset 数据个数6、查询指定元素在 Zset 有序集合中的排名三、增加操作1、向 Red…...
![](https://img-blog.csdnimg.cn/55a3dd1bb4324fcd921f392b5236dd5f.png#pic_center)
Java特性之设计模式【策略模式】
一、策略模式 概述 在策略模式(Strategy Pattern)中,一个类的行为或其算法可以在运行时更改。这种类型的设计模式属于行为型模式 在策略模式中,我们创建表示各种策略的对象和一个行为随着策略对象改变而改变的 context 对象。策略…...
![](https://www.ngui.cc/images/no-images.jpg)
IR-CUT 保证摄像机成像效果的滤镜
IR-CUT双滤镜是指在摄像头镜头组里内置了一组滤镜,当镜头外的红外感应点侦测到光线的强弱变化后,内置的IR-CUT自动切换滤镜能够根据外部光线的强弱随之自动切换,使图像达到最 佳效果。也就是说,在白天或黑夜下,双滤光片…...
![](https://img-blog.csdnimg.cn/abb37a674d974308837aab46ae72cc41.png)
openpnp - 普通航空插头和PCB的连接要使用线对板连接器
文章目录openpnp - 普通航空插头和PCB的连接要使用线对板连接器概述改进实际效果总结ENDopenpnp - 普通航空插头和PCB的连接要使用线对板连接器 概述 和同学讨论问题, 准备将航空插头连接到PCB上. 航空插头选用GX12-4公头, 拧到开孔的铁板上. 然后航空插头公头再与PCB连接. 铁…...
![](https://img-blog.csdnimg.cn/cdd8ff457875409da9db8b6b1983a0af.png)
Python3 错误和异常实例及演示
作为 Python 初学者,在刚学习 Python 编程时,经常会看到一些报错信息,在前面我们没有提及,这章节我们会专门介绍。 Python 有2种错误很容易辨认:语法错误和异常。 Python assert(断言)用于判断…...
![](https://www.ngui.cc/images/no-images.jpg)
Android 9.0第三方app根据包名设置为横屏显示
1.概述 在android9.0的系统rom定制化开发中,在某些横屏的设备比如平板电脑,tv智能电视,广告机等等设备中,通常系统是默认横批显示的,但是在安装一些竖屏app的时候, 就会旋转为竖屏,这个时候操作app也不方便,所以产品需求要求竖屏也需要根据包名横屏显示出来,这就需要在…...
![](https://www.ngui.cc/images/no-images.jpg)
MySQL会导致索引失效的情况与解决索引失效的方法
什么情况会导致索引失效 索引失效也是慢查询的主要原因之一,常见的导致索引失效的情况有下面这些: 1.使用 SELECT * 进行查询;2.创建了组合索引,但查询条件未准守最左匹配原则;3.在索引列上进行计算、函数、类型转换等操作;4.以 % 开头的 L…...
![](https://img-blog.csdnimg.cn/9cb4f23c776f4a8e9c6519850a5fa010.png)
使用nginx单独部署Vben应用
前言 本文主要介绍Vben使用nginx单独部署的方式,其实前端发展到现在已经不是当年的jsp,asp必须要和后端一起部署了。单独部署调试的工具也很多,比如vue-cli-service 和 Vben中用到的vite ,当然这些我们一般用在开发的工程中。正式…...
![](https://img-blog.csdnimg.cn/c5b652eba8904ae7a98d606937d112ad.png)
ES6新特性详解
文章目录1. let和const1.1 let声明变量1.2 const声明常量2. 模板字符串3. 解构赋值3.1 数组的解构赋值3.2 对象的解构赋值4. 函数扩展4.1 参数默认值4.2 剩余参数4.3 箭头函数5. 对象扩展5.1 对象简写5.2 属性名表达式5.3 扩展运算符6. Symbol7. Iterator和Generator7.1 Iterat…...
![](https://img-blog.csdnimg.cn/e9d44d73c7dc43388dec36cf4f6567d9.png)
Ubuntu下安装 ntfs-3g
目录1.FAT32、NTFS和exFAT2.ubuntu 安装 ntfs-3g2.1 直接安装2.2 源码安装1.FAT32、NTFS和exFAT U盘在格式化的时候都会有三种格式分别是FAT32、NTFS和exFAT。 FAT32格式 FAT32格式硬盘分区的最大容量为2TB,虽然U盘做不到,但是现在1xTB硬盘都有了&…...
![](https://www.ngui.cc/images/no-images.jpg)
【专业认知】抖音就业 / 保研北大教育学 / 留学南加州EE / 微软就业
2023.2.18 一. 周金辉学长分享——本科经验分享 0 简介 计算机农大本硕 硕士毕业后在抖音公司工作 1 行业前景:计算机专业能做什么? 1.1 计算机行业发展路线 远古时代: 二战开始,计算机技术发展,出现互联网 包…...
![](https://www.ngui.cc/images/no-images.jpg)
【算法题】2 的 n 次幂的背后
前言: 说实话,真的不爱写算法题相关的文章了,觉得没啥意义,但是对这种比较好玩并且简单,学会了就能很好提高算法效率的文章,还是要写一写,不哭不哭,你不会不是你的错,只是…...
![](https://www.ngui.cc/images/no-images.jpg)
【人工智能AI】一、NoSQL 企业级基础入门《NoSQL 企业级基础入门与进阶实战》
写一篇介绍什么是NoSQL的技术文章,分5个章节,每个章节细分到3级目录,重点介绍一下优缺点,适用场景,未来发展趋势等。 一、NoSQL简介 1.1 什么是NoSQL NoSQL(Not only SQL),意思是“…...
![](https://img-blog.csdnimg.cn/0f5595f6cb1e4be197a2fb8940185c0b.png)
Ubuntu安装opencv库3.4.10,并在cmake工程中引入opencv库
Windows下安装不同,Ubuntu安装OpenCV库时,需要事先安装依赖,而且不同OpenCV库所需的依赖可能会有所不同,下面的依赖亲测 3.4.10 和 4.5.5版本的有效,但是4.6以上版本安装可能会报错。 参考链接:https://bl…...
![](https://img-blog.csdnimg.cn/38cfe37407924b50ac66331b4d797796.png)
实现8086虚拟机(四)——mov 和 jmp 指令解码
文章目录mov 指令解码jmp 指令解码这篇文章举例来讲讲 mov 指令和 jmp 指令解码函数的实现,其他的指令解码函数都与这些类似。mov 指令解码 以 mov 指令中的一类:寄存器/内存 到/从 寄存器,来详细说明解码函数的实现。 机器指令格式如下&am…...
![](https://img-blog.csdnimg.cn/dec3b75aa19a476999b835fb4cc4b360.png)
数据库技术-函数依赖、键与约束、范式
一、函数依赖 给定一个x,能唯一确定一个Y,就称x确定Y,或者说Y依赖于x,例如YX*X函数。 函数依赖又可扩展以下两种规则: 部分函数依赖:A可确定C,(A,B)也可确定C,(A,B)中的一部分(即A)可以确定C&a…...
![](https://img-blog.csdnimg.cn/81e31e8ecb5e45b382b21d835d7ef587.png)
shiro CVE-2020-1957
0x00 前言 在之前只是单纯的复现了漏洞,没有记笔记,所以补充了这篇分析笔记。 影响版本:shiro < 1.5.2 0x01 环境搭建 环境用的是:https://github.com/lenve/javaboy-code-samples/tree/master/shiro/shiro-basic 0x02 漏…...
![](https://img-blog.csdnimg.cn/c5614108e1704c60a03591a4e9f870e6.png#pic_center)
RabbitMQ 入门到应用 ( 五 ) 基本应用
6.更多应用 6.1.AmqpAdmin 工具类 可以通过Spring的Autowired 注入 AmqpAdmin 工具类 , 通过这个工具类创建 队列, 交换机及绑定 import org.springframework.amqp.core.AmqpAdmin; import org.springframework.amqp.core.Binding; import org.springframework.amqp.core.Di…...
![](https://img-blog.csdnimg.cn/img_convert/a4015666ba468e8465fe7882f22308e2.jpeg)
部署dapr的辛酸历程
前言dapr大概的了解,个人理解他就是一个分布式服务的管理,把微服务常用的组件(缓存,消息中间件、分布式锁、安全id4等)和监控以及服务注册、发现等等一系列功能以一个很抽象的方式管理起来。可能我们部署微服务用consul、ocelot、polly套件、…...
![](https://img-blog.csdnimg.cn/beaa3a7242224e82b48635f257c3386c.png)
golang入门笔记——内存管理
文章目录自动内存管理概念自动内存管理-相关概念:追踪垃圾回收:分代GC(Generational GC)引用计数内存分配Go内存分配-分块Go内存分配——多级缓存Go内存管理优化Balanced GC自动内存管理 概念 1.动态内存 程序在运行时根据需求…...
![](https://www.ngui.cc/images/no-images.jpg)
97. 约数之和
Powered by:NEFU AB-IN Link 文章目录97. 约数之和题意思路代码97. 约数之和 题意 假设现在有两个自然数 A和 B,S是 A^B的所有约数之和。 请你求出 S mod 9901的值是多少。 思路 ABA^BAB的约数之和为:sumAB(1p1p12...p1Ba1)(1p2p22...p2Ba2)...sum_{A^B…...
![](https://www.ngui.cc/images/no-images.jpg)
想和20岁的自己说
男生床头千万不要放卫生纸不要叫自己的女朋友早睡,更不能叫她早起,否则有你好受的。成年人的默契:和异性单独出去旅游,如果没有明确拒绝开一间房,那基本上默认后面会发生的事情不要去考验人性,世上99%的人经…...
![](https://img-blog.csdnimg.cn/456fbaa295e14dfeb024b7a3ba897db7.png)
Unit Test and Integration Test
Unit Test and Integration Test Background It is the first time that I try to write an article in English. In the past, I didn’t write test code. Just thinking QA is responsible for testing. As a developer, I don’t need to care about tests. Although I …...
![](https://img-blog.csdnimg.cn/548f2e576c52434fb738812a0406fb99.png)
2022年全国职业院校技能大赛(中职组)网络安全竞赛试题(3)
目录 模块A 基础设施设置与安全加固 (本模块20分) 一、项目和任务描述: 假定你是某企业的网络安全工程师,对于企业的服务器系统,根据任务要求确保各服务正常运行,并通过综合运用用户安全管理与密码策略、…...
![](https://img-blog.csdnimg.cn/img_convert/49690a20f3de0bf376a465c8b392f85a.jpeg)
智慧城市应急指挥中心数字化及城市驾驶舱建设方案
目 录 第一章 项目概述 1.1 项目背景 1.2 项目范围 第二章 建设内容 2.1 三维可视化平台 2.1.1 多源数据接入 2.1.2 可视化编排 2.1.3 三维可视化编辑 2.1.4 空间数据可视化 2.1.5 集成框架支持 2.2 可视化场景定制开发 2.2.1 城市驾驶总舱 2.2.2 城市安全分舱 2.…...
![](/images/no-images.jpg)
网站设计 中国风/如何优化推广中的关键词
FileReader:用来读取字符文件的便捷类。此类的构造方法假定默认字符编码和默认字节缓冲区大小都是适当的。要自己指定这些值,可以先在 FileInputStream 上构造一个 InputStreamReader。FileReader 用于读取字符流。要读取原始字节流,请考虑使…...
![](/images/no-images.jpg)
新冠走了几百万老年人/杭州seo排名公司
Java,模仿练习,输出三行信息问题描述模仿练习,编写程序,输出三行信息Write the program to display threemessages.要求:请不要复制参考代码,在开发工具上手工录入代码,运行正确后,在OJ上提交代码;参考代码…...
![](/images/no-images.jpg)
亳州做网站哪家好/樱桃bt磁力天堂
实际生产开发中,遇到突发情况,需要紧急修复线上bug,但是灰度环境(或者其他预生产测试环境)已经存在多个新功能的代码了,这时候我们可能选择直接在生产tag版本的代码上进行修复并发布。 local_branch : 本地分支名 tag_name : 生…...
![](https://www.oschina.net/img/hot3.png)
wordpress适合做什么网站/推广竞价账户托管
为什么80%的码农都做不了架构师?>>> apache Httpclient基于java BIO实现的,也是基于apache HttpCore项目。他最基本的功能是执行HTTP方法。HttpClient的API的主要入口就是HttpClient接口,看看这个示例: package httpc…...
![](/images/no-images.jpg)
网站前端包括哪些/最新百度新闻
上星期机器当机, 很奇怪的是, 隔壁的机器居然也在几分钟后一起当了.注1: 两台做的事情完全不同, 而且机器都不操.注2: 两台都是 Ubuntu Linux.问题重新开机后, 查看当机前发生的事情, 都是出现下述消息:$ sudo less /var/log/syslogOct 8 20:15:13 example kernel: [5695418.3…...
![](/images/no-images.jpg)
京东商城企业网站建设分析/百度统计
一、TCP 1、建立连接 2、发送的会检测是否成功,有重发机制 TCP(Transmission Control Protocol 传输控制协议)是一种面向连接的、可靠的、基于字节流的传输层通信协议 TCP把数据流分区成适当长度的报文段, 之后TCP把结果包传给I…...