徐州网红有哪些人/淘宝seo是什么
文章目录
- 一、概述
- 二、编码实现
- 1. pom文件引入组件
- 2. 核心代码
- 三、功能测试
- 1. 测试文件
- 2. 测试代码
- 四,完整代码
一、概述
带有API接口交互的web项目开发过程中,json字符串与javaBean对象之间的相互转换是比较常见的需求,基于jackson ObjectMapper 实现的工具类较好的满足了此需求。
二、编码实现
1. pom文件引入组件
<dependency><groupId>org.springframework</groupId><artifactId>spring-webflux</artifactId><version>5.2.3.RELEASE</version></dependency><dependency><groupId>io.projectreactor.netty</groupId><artifactId>reactor-netty</artifactId><version>0.9.4.RELEASE</version></dependency><dependency><groupId>org.apache.logging.log4j</groupId><artifactId>log4j-slf4j-impl</artifactId><version>2.12.1</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.10.2</version></dependency><dependency><groupId>org.apache.commons</groupId><artifactId>commons-lang3</artifactId><version>3.10</version></dependency><dependency><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>2.5</version></dependency><dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter-api</artifactId><version>5.5.2</version><scope>test</scope></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.12</version><scope>provided</scope></dependency>
2. 核心代码
JsonBeanUtils
import java.io.IOException;import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;/*** JsonBean转换工具* * @author 00fly**/
public class JsonBeanUtils
{private static ObjectMapper objectMapper = new ObjectMapper();/*** bean转json字符串* * @param bean* @return* @throws IOException*/public static String beanToJson(Object bean)throws IOException{String jsonText = objectMapper.writeValueAsString(bean);return objectMapper.readTree(jsonText).toPrettyString();}/*** json字符串转bean* * @param jsonText* @return* @throws IOException*/public static <T> T jsonToBean(String jsonText, Class<T> clazz)throws IOException{return objectMapper.readValue(jsonText, clazz);}/*** json字符串转bean* * @param jsonText* @return* @throws IOException*/public static <T> T jsonToBean(String jsonText, JavaType javaType)throws IOException{return objectMapper.readValue(jsonText, javaType);}/*** json字符串转bean* * @param jsonText* @return* @throws IOException*/public static <T> T jsonToBean(String jsonText, TypeReference<T> typeRef)throws IOException{return objectMapper.readValue(jsonText, typeRef);}
}
三、功能测试
1. 测试文件
jdbc.properties
druid.username=sa
druid.password=
druid.url=jdbc:h2:mem:hello;database_to_upper=false
druid.driverClassName=org.h2.Driver
data.json
{"code": 200,"message": "success","traceId": "fcd55497-864a-4d74-9db0-69a04655184f","data": {"list": [{"articleId": 135418954,"title": "java解析json复杂数据的两种思路","description": "萌新小明最近新开了CSDN博客,蠢蠢欲动,迫不及待的发表了几篇工作中积累下来的解决问题的涂鸦之作,看着访问量慢慢涨起来,心中暗暗窃喜。现在小明想每天23点记录一下每篇文章的访问量。。。","url": "https://blog.csdn.net/qq_16127313/article/details/135418954","type": 1,"top": false,"forcePlan": false,"viewCount": 828,"commentCount": 0,"editUrl": "https://editor.csdn.net/md?articleId=135418954","postTime": "2024-01-06 14:11:40","diggCount": 16,"formatTime": "前天 14:11","picList": ["https://img-blog.csdnimg.cn/direct/a409a0f4555c459fa05c00fd9ee0ea8c.png"],"collectCount": 19},{"articleId": 135244727,"title": "java lambda表达式训练题一","description": "Lambda 表达式,也可称为闭包,它是推动 Java 8 发布的最重要新特性。Lambda 允许把函数作为一个方法的参数(函数作为参数传递进方法中)。使用 Lambda 表达式可以使代码变的更加简洁紧凑。","url": "https://blog.csdn.net/qq_16127313/article/details/135244727","type": 1,"top": false,"forcePlan": false,"viewCount": 1238,"commentCount": 0,"editUrl": "https://editor.csdn.net/md?articleId=135244727","postTime": "2023-12-27 18:07:30","diggCount": 7,"formatTime": "2023.12.27","picList": ["https://img-blog.csdnimg.cn/direct/d59c68b950754e879914b5319cd1b53f.png"],"collectCount": 8},{"articleId": 135173565,"title": "二维码初体验 com.google.zxing 实现续 - web api封装","description": "在 二维码初体验 com.google.zxing 实现 我们实现了二维码的生成,但是大部分情况下,二维码的相关功能是作为API接口来提供服务的。我们下面便演示在springboot、Knife4j下封装api接口来实现二维码生成功能。如何使用下面的备份文件恢复成原始的项目代码,请移步查阅:神奇代码恢复工具-over-","url": "https://blog.csdn.net/qq_16127313/article/details/135173565","type": 1,"top": false,"forcePlan": false,"viewCount": 1904,"commentCount": 0,"editUrl": "https://editor.csdn.net/md?articleId=135173565","postTime": "2023-12-23 20:17:11","diggCount": 23,"formatTime": "2023.12.23","picList": ["https://img-blog.csdnimg.cn/direct/f0c994ca789a495a8c8c03d86d626f24.jpeg"],"collectCount": 23},{"articleId": 135167613,"title": "二维码初体验 com.google.zxing 实现","description": "Java 操作二维码的开源项目很多,如 SwetakeQRCode、BarCode4j、Zxing 等,这边以Zxing 为例进行介绍。选择需要生成QR原始文件,支持 “清除空白行及空格” 以减少二维码图片大小。支持输入文本内容,直接生成二维码代码结构QrCodeUI: 完整版本代码SimpleQrCodeUI:简化版本代码如何使用下面的备份文件恢复成原始的项目代码,请移步查阅:神奇代码恢复工具-over-","url": "https://blog.csdn.net/qq_16127313/article/details/135167613","type": 1,"top": false,"forcePlan": false,"viewCount": 1286,"commentCount": 0,"editUrl": "https://editor.csdn.net/md?articleId=135167613","postTime": "2023-12-23 13:52:23","diggCount": 6,"formatTime": "2023.12.23","picList": ["https://img-blog.csdnimg.cn/direct/d3eeac85857543869dce8967c570bdc4.jpeg"],"collectCount": 11},{"articleId": 135135799,"title": "【随笔】MD5加密字符串、文件apache、springframework实现","description": "【代码】【随笔】MD5加密字符串、文件commons-codec、springframework实现。","url": "https://blog.csdn.net/qq_16127313/article/details/135135799","type": 1,"top": false,"forcePlan": false,"viewCount": 1721,"commentCount": 0,"editUrl": "https://editor.csdn.net/md?articleId=135135799","postTime": "2023-12-21 17:29:54","diggCount": 9,"formatTime": "2023.12.21","picList": ["https://img-blog.csdnimg.cn/direct/dc26b7f1c731494f80c8c3b3badfa95d.jpeg"],"collectCount": 9}],"total": 72}
}
2. 测试代码
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Properties;import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.client.WebClient;import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.type.TypeFactory;import lombok.Data;
import lombok.extern.slf4j.Slf4j;/*** JsonBeanUtils测试*/
@Slf4j
public class JsonBeanUtilsTest
{static String jsonText;static Properties properties;static WebClient webClient;static String url;@BeforeAllpublic static void init(){try{properties = PropertiesLoaderUtils.loadProperties(new ClassPathResource("jdbc.properties"));jsonText = IOUtils.toString(new ClassPathResource("data.json").getURL(), StandardCharsets.UTF_8);webClient = WebClient.builder().codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(-1)).build();url = "https://blog.csdn.net/community/home-api/v1/get-business-list?page=1&size=5&businessType=blog&username=qq_16127313";}catch (IOException e){log.error(e.getMessage(), e);}}@Testpublic void propsTest()throws IOException{String propsJson = JsonBeanUtils.beanToJson(properties);log.info("propsJson : {} ", propsJson);log.info("properties: {} ", JsonBeanUtils.jsonToBean(propsJson, Properties.class));}@Testpublic void beanToJson001()throws IOException{BlogData blogData = JsonBeanUtils.jsonToBean(jsonText, BlogData.class);log.info("blogData: {} ", blogData);log.info("blogData: {} ", JsonBeanUtils.beanToJson(blogData));log.info("blogData.data: {} ", JsonBeanUtils.beanToJson(blogData.getData()));log.info("blogData.data.list: {} ", JsonBeanUtils.beanToJson(blogData.getData().getList()));}@Testpublic void beanToJson002()throws IOException{String resp = webClient.get().uri(url).acceptCharset(StandardCharsets.UTF_8).accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(String.class).block();BlogData blogData = JsonBeanUtils.jsonToBean(resp, BlogData.class);String jsonText = JsonBeanUtils.beanToJson(blogData);log.info("blogData: {} ", blogData);log.info("jsonText: {} ", jsonText);}/*** 测试 JsonBeanUtils.jsonToBean(String jsonText, JavaType javaType)* * @throws IOException*/@Testpublic void jsonToBean001()throws IOException{BlogData blogData = JsonBeanUtils.jsonToBean(jsonText, BlogData.class);String jsonStr = JsonBeanUtils.beanToJson(blogData.getData().getList());// List<SubList>JavaType javaType = TypeFactory.defaultInstance().constructParametricType(List.class, SubList.class);List<SubList> dataEntitys = JsonBeanUtils.jsonToBean(jsonStr, javaType);log.info("dataEntitys: {} ", dataEntitys);}/*** 测试 JsonBeanUtils.jsonToBean(String jsonText, TypeReference<T> typeRef)* * @throws IOException*/@Testpublic void jsonToBean002()throws IOException{BlogData blogData = JsonBeanUtils.jsonToBean(jsonText, BlogData.class);String jsonStr = JsonBeanUtils.beanToJson(blogData.getData().getList());// List<SubList>TypeReference<List<SubList>> typeRef = new TypeReference<List<SubList>>(){};List<SubList> dataEntitys = JsonBeanUtils.jsonToBean(jsonStr, typeRef);log.info("dataEntitys: {} ", dataEntitys);}
}@Data
class BlogData
{private Integer code;private String message;private String traceId;private Record data;
}@Data
class Record
{private List<SubList> list;private Long total;
}@Data
class SubList
{String articleId;String title;String description;String url;Integer type;String top;String forcePlan;Long viewCount;Long commentCount;String editUrl;String postTime;Long diggCount;String formatTime;Object picList;Long collectCount;
}
四,完整代码
如何使用下面的备份文件恢复成原始的项目代码,请移步查阅:神奇代码恢复工具
//goto pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.fly</groupId><artifactId>base</artifactId><version>0.0.1</version><name>base</name><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><java.version>1.8</java.version><skipTests>true</skipTests></properties><dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-webflux</artifactId><version>5.2.3.RELEASE</version></dependency><dependency><groupId>io.projectreactor.netty</groupId><artifactId>reactor-netty</artifactId><version>0.9.4.RELEASE</version></dependency><dependency><groupId>org.apache.logging.log4j</groupId><artifactId>log4j-slf4j-impl</artifactId><version>2.12.1</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.10.2</version></dependency><dependency><groupId>org.apache.commons</groupId><artifactId>commons-lang3</artifactId><version>3.10</version></dependency><dependency><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>2.5</version></dependency><dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter-api</artifactId><version>5.5.2</version><scope>test</scope></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.12</version><scope>provided</scope></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.10.1</version><configuration><source>1.8</source><target>1.8</target><encoding>UTF-8</encoding></configuration></plugin></plugins></build>
</project>
//goto src\main\java\com\fly\core\utils\JsonBeanUtils.java
package com.fly.core.utils;import java.io.IOException;import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;/*** JsonBean转换工具* * @author 00fly**/
public class JsonBeanUtils
{private static ObjectMapper objectMapper = new ObjectMapper();/*** bean转json字符串* * @param bean* @return* @throws IOException*/public static String beanToJson(Object bean)throws IOException{String jsonText = objectMapper.writeValueAsString(bean);return objectMapper.readTree(jsonText).toPrettyString();}/*** json字符串转bean* * @param jsonText* @return* @throws IOException*/public static <T> T jsonToBean(String jsonText, Class<T> clazz)throws IOException{return objectMapper.readValue(jsonText, clazz);}/*** json字符串转bean* * @param jsonText* @return* @throws IOException*/public static <T> T jsonToBean(String jsonText, JavaType javaType)throws IOException{return objectMapper.readValue(jsonText, javaType);}/*** json字符串转bean* * @param jsonText* @return* @throws IOException*/public static <T> T jsonToBean(String jsonText, TypeReference<T> typeRef)throws IOException{return objectMapper.readValue(jsonText, typeRef);}
}
//goto src\main\resources\log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration status="off" monitorInterval="0"><appenders><console name="Console" target="system_out"><patternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" /></console></appenders><loggers><root level="INFO"><appender-ref ref="Console" /></root></loggers>
</configuration>
//goto src\test\java\com\fly\core\utils\JsonBeanUtilsTest.java
package com.fly.core.utils;import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Properties;import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.client.WebClient;import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.type.TypeFactory;import lombok.Data;
import lombok.extern.slf4j.Slf4j;/*** JsonBeanUtils测试*/
@Slf4j
public class JsonBeanUtilsTest
{static String jsonText;static Properties properties;static WebClient webClient;static String url;@BeforeAllpublic static void init(){try{properties = PropertiesLoaderUtils.loadProperties(new ClassPathResource("jdbc.properties"));jsonText = IOUtils.toString(new ClassPathResource("data.json").getURL(), StandardCharsets.UTF_8);webClient = WebClient.builder().codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(-1)).build();url = "https://blog.csdn.net/community/home-api/v1/get-business-list?page=1&size=5&businessType=blog&username=qq_16127313";}catch (IOException e){log.error(e.getMessage(), e);}}@Testpublic void propsTest()throws IOException{String propsJson = JsonBeanUtils.beanToJson(properties);log.info("propsJson : {} ", propsJson);log.info("properties: {} ", JsonBeanUtils.jsonToBean(propsJson, Properties.class));}@Testpublic void beanToJson001()throws IOException{BlogData blogData = JsonBeanUtils.jsonToBean(jsonText, BlogData.class);log.info("blogData: {} ", blogData);log.info("blogData: {} ", JsonBeanUtils.beanToJson(blogData));log.info("blogData.data: {} ", JsonBeanUtils.beanToJson(blogData.getData()));log.info("blogData.data.list: {} ", JsonBeanUtils.beanToJson(blogData.getData().getList()));}@Testpublic void beanToJson002()throws IOException{String resp = webClient.get().uri(url).acceptCharset(StandardCharsets.UTF_8).accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(String.class).block();BlogData blogData = JsonBeanUtils.jsonToBean(resp, BlogData.class);String jsonText = JsonBeanUtils.beanToJson(blogData);log.info("blogData: {} ", blogData);log.info("jsonText: {} ", jsonText);}/*** 测试 JsonBeanUtils.jsonToBean(String jsonText, JavaType javaType)* * @throws IOException*/@Testpublic void jsonToBean001()throws IOException{BlogData blogData = JsonBeanUtils.jsonToBean(jsonText, BlogData.class);String jsonStr = JsonBeanUtils.beanToJson(blogData.getData().getList());// List<SubList>JavaType javaType = TypeFactory.defaultInstance().constructParametricType(List.class, SubList.class);List<SubList> dataEntitys = JsonBeanUtils.jsonToBean(jsonStr, javaType);log.info("dataEntitys: {} ", dataEntitys);}/*** 测试 JsonBeanUtils.jsonToBean(String jsonText, TypeReference<T> typeRef)* * @throws IOException*/@Testpublic void jsonToBean002()throws IOException{BlogData blogData = JsonBeanUtils.jsonToBean(jsonText, BlogData.class);String jsonStr = JsonBeanUtils.beanToJson(blogData.getData().getList());// List<SubList>TypeReference<List<SubList>> typeRef = new TypeReference<List<SubList>>(){};List<SubList> dataEntitys = JsonBeanUtils.jsonToBean(jsonStr, typeRef);log.info("dataEntitys: {} ", dataEntitys);}
}@Data
class BlogData
{private Integer code;private String message;private String traceId;private Record data;
}@Data
class Record
{private List<SubList> list;private Long total;
}@Data
class SubList
{String articleId;String title;String description;String url;Integer type;String top;String forcePlan;Long viewCount;Long commentCount;String editUrl;String postTime;Long diggCount;String formatTime;Object picList;Long collectCount;
}
//goto src\test\resources\jdbc.properties
druid.username=sa
druid.password=
druid.url=jdbc:h2:mem:hello;database_to_upper=false
druid.driverClassName=org.h2.Driver
//goto src\test\resources\log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration status="off" monitorInterval="0"><appenders><console name="Console" target="system_out"><patternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" /></console></appenders><loggers><root level="INFO"><appender-ref ref="Console" /></root></loggers>
</configuration>
有任何问题和建议,都可以向我提问讨论,大家一起进步,谢谢!
-over-
相关文章:

基于jackson封装的json字符串与javaBean对象转换工具
文章目录 一、概述二、编码实现1. pom文件引入组件2. 核心代码 三、功能测试1. 测试文件2. 测试代码 四,完整代码 一、概述 带有API接口交互的web项目开发过程中,json字符串与javaBean对象之间的相互转换是比较常见的需求,基于jackson Objec…...

js中的数据类型
JavaScript 中有以下几种常见的数据类型: 基本类型(原始类型): 字符串(String):表示文本数据。数字(Number):表示数值数据。布尔(Boolean…...

vue3+vant+cropper.js实现移动端图片裁剪功能
一、前言 最近做项目中遇到一个需求,需要对海报图片按照一定的比例进行裁剪并上传到oss。一开始这个需求思路有两个,使用canvas原生或者寻找现成的第三方库,对比了一番觉得canvas实现时间耗费较长,且秉承着不重复造轮子的原则&am…...

springCould中的Bus-从小白开始【11】
目录 🧂1.Bus是什么❤️❤️❤️ 🌭2.什么是总线❤️❤️❤️ 🥓3.rabbitmq❤️❤️❤️ 🥞4.新建模块3366❤️❤️❤️ 🍳5.设计思想 ❤️❤️❤️ 🍿6.添加消息总线的支持❤️❤️❤️ ǹ…...

xshell和xftp
1.xshell和xftp的关系 Xftp和Xshell都是Xmanager Power Suite的组件,它们的功能和用途有所不同。 Xshell是一个用于MS Windows平台的强大的SSH、telnet和rlogin终端仿真软件,它使得用户能轻松和安全地从Windows PC上访问Unix/Linux主机。 Xftp是一个用…...

python for...else用法,一个实例就能让你明白
直接上代码,很简单,不用讲解吧,看不懂的话,就需要补充下基础知识了。 def funct2():for i in range(4):try:assert i>2print("success")breakexcept Exception as e:print(error)continueelse:print(循环不合预期)d…...

windows 设置ip命令bat脚本
您可以使用以下命令创建一个批处理文件(.bat)来添加IP地址: echo off set ipaddress set subnetmask set gatewaynetsh interface ip set address name"以太网" sourcestatic address%ipaddress% mask%subnetmask% gateway%gatewa…...

Openharmony 对应Android内存查看
众所周知,内存查看是一个很重要的部分,大多数情况,我们都是使用dumpsys的方法对android的内存进行查看,但是对于openharmony而言好像又不太一样了。 Android内存查看 命令行: adb shell dumpsys meminfo <packag…...

R语言【paleobioDB】——pbdb_interval():通过ID选择,返回一个地层年代段的基本信息
Package paleobioDB version 0.7.0 paleobioDB 包在2020年已经停止更新,该包依赖PBDB v1 API。 可以选择在Index of /src/contrib/Archive/paleobioDB (r-project.org)下载安装包后,执行本地安装。 Usage pbdb_interval (id, ...) Arguments 参数【id】…...

spring boot mybatis plus mapper如何自动注册到spring bean容器
##Import(AutoConfiguredMapperScannerRegistrar.class) ##注册MapperScannerConfigurer ##MapperScannerConfigurer.postProcessBeanDefinitionRegistry方法扫描注册mapper ##找到mapper候选者 ##过滤mapper 类 候选者 ##BeanDefinitionHolder注册到spring 容器...

What is `@PathVariable` does?
PathVariable 是SpringMVC中的注解,用于将HTTP请求的URI路径变量映射到Controller方法参数上。 当URL路径中包含占位符(由大括号 {} 包围的部分)时,可以使用此注解来绑定这些动态部分到方法参数。 使用样例 获取单个路径变量 …...

如何利用小程序介绍公司品牌形象?
企业小程序的建设对于现代企业来说已经成为了一项必不可少的工作。随着移动互联网的快速发展,越来越多的职场人士和创业老板希望通过小程序来提升企业形象,增强与用户的互动,实现更好的商业效果。在这个过程中,使用第三方制作平台…...

[C#]使用sdcb.paddleocr部署v4版本ocr识别模型
【官方框架地址】 https://github.com/sdcb/PaddleSharp 【算法介绍】 PaddleOCR,全称为PaddlePaddle OCR,是PaddlePaddle深度学习平台下的一款强大的光学字符识别工具。它利用深度学习技术,实现了高精度的文字识别,可以帮助用户…...

Echarts图表如何利用formatter自定义tooltip的内容和样式
在展示多数据图表的时候 有的时候需要图例也展示出一些内容来,例如官方这样子:鼠标悬停的时候展示该点数据 但是,官方提供的样式有时不适用所有的开发场景 我的项目需要实现鼠标悬停在某一点的时候,只展示该条线的数据࿰…...

Ceph源码分析-s->req_id = store->svc()->zone_utils->unique_id(req->id)
s->req_id store->svc()->zone_utils->unique_id(req->id); 涉及到指针和对象方法的调用。我会逐步为你解释这行代码的含义。 s->req_id ...; s 是一个指针,它指向一个结构或类。req_id 是该结构或类的一个成员变量。这行代码的意思是ÿ…...

Unity中的异步编程【7】——在一个异步方法里播放了animation动画,取消任务时,如何停止动画播放
用一个异步方法来播放一个动画,正常情况是:动画播放结束时,异步方法宣告结束。那如果我提前取消这个异步任务,那在这个异步方法里面,我要怎么停止播放呢?! 一、播放animation动画的异步实现 1…...

vue3中ref和reactive联系与区别以及如何选择
vue3中ref和reactive区别与联系 区别 1、ref既可定义基本数据类型,也可以定义引用数据类型,reactive只能定义应用数据类型 2、ref在js中取响应值需要使用 .value,而reactive则直接取用既可 3、ref定义的对象通过.value重新分配新对象时依旧…...

面试宝典之spring框架常见面试题
F1、类的反射机制有啥用? (1)增加程序的灵活性,可扩展性,动态创建对象。 (2)框架必备,任何框架的封装都要用反射。(框架的灵魂) F2、获取Class对象的三种方…...

建筑垃圾处理行业分析:正在被越来越广泛的运用
建筑垃圾处理,是将固体废弃物作为再生资源重新利用的一种方式。建筑垃圾是在对建筑物实施新建、改建、扩建或者是拆除过程中产生的固体废弃物。建筑垃圾一般可分为建设废物、拆除垃圾及装修垃圾。因此建筑垃圾处理行业可以分为建设废物处理、拆除垃圾处理、装修垃圾…...

【DIY summaries on Linux】
DIY Linux summaries 1) difference between ways of creation file and edit files1.1) echoecho talk to yourself touch 1) difference between ways of creation file and edit files 1.1) echo ###) > echo talk to yourself touch...

Redis(概述、应用场景、线程模式、数据持久化、数据一致、事务、集群、哨兵、key过期策略、缓存穿透、击穿、雪崩)
目录 Redis概述 应用场景 Redis的线程模式 数据持久化 1.Rdb(Redis DataBase) 2.Aof(Append Only File) mysql与redis保持数据一致 redis事务 主从复制(Redis集群) 哨兵模式 key过期策略 缓存穿透、击穿、…...

ospf-gre隧道小练习
全网可达,R5路由表没有其他路由器的路由条目 注:每个路由器都添加了自己的环回,如R1就是1.1.1.1 R1可以分别ping通与R2,R3,R4之间的隧道 R1路由表上有所有路由器环回的路由条目 R5路由表上没有其他路由器的路由条目 实现代码: 首先将各个接口IP配好 边上3个路由器:[R6][R7][R…...

C++入门【29-C++ 把引用作为返回值】
通过使用引用来替代指针,会使 C 程序更容易阅读和维护。C 函数可以返回一个引用,方式与返回一个指针类似。 当函数返回一个引用时,则返回一个指向返回值的隐式指针。这样,函数就可以放在赋值语句的左边。例如,请看下面…...

基于Java SSM框架实现企业车辆管理系统项目【项目源码】
基于java的SSM框架实现企业车辆管理系统演示 JSP技术 JSP技术本身是一种脚本语言,但它的功能是十分强大的,因为它可以使用所有的JAVA类。当它与JavaBeans 类进行结合时,它可以使显示逻辑和内容分开,这就极大的方便了运动员的需求…...

MyBatis的配置及简单使用
1.配置myBatis 1.myBatis的作用 MyBatis 是一个开源的持久层框架,它的主要作用是简化数据库操作,使得开发者能够更方便地与数据库进行交互。 MyBatis 允许开发者使用简单的 XML 或注解配置 SQL 映射,从而实现数据库操作,而不需要…...

【UE Niagara学习笔记】07 - 火焰的热变形效果
目录 效果 步骤 一、创建热变形材质 二、添加新的发射器 2.1 设置粒子材质 2.2 设置粒子初始大小 2.3 设置粒子持续生成 三、修改材质 四、设置粒子效果 在上一篇博客(【UE Niagara学习笔记】06 - 制作火焰喷射过程中飞舞的火星)的基础上继续…...

深度学习模型中 argparse 模块Python 脚本的部分参数解读
尤其注意下面这句中的action"store_true"的作用解析: --resume_ckpt 是一个标志参数,它不需要附加值。如果将该参数作为命令行参数传递给脚本,则 resume_ckpt 的值将被设置为 True。action"store_true" 意味着如果在命令…...

在win10和Linux上配置SSH 无密码登录
文章目录 一、用途二、在本地机器上使用ssh-keygen产生公钥私钥对1)在Linux (或macOS) 上产生SSH公私钥的方法2)在win10上产生SSH公私钥的方法a)检查windows 本地是否安装有sshb)在本地生成SSH密钥对(公钥和私钥&#…...

【VUE】无法加载文件 \node\vue.ps1,因为在此系统上禁止运行脚本。问题解决
问题描述 在VS Code中输入vue create -p dcloudio/uni-preset-vue uniapp-demo命令时报错 无法加载文件 D:\address\node\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID135170 中的 about_Executi…...

C //练习 4-12 运用printd函数的设计思想编写一个递归版本的itoa函数,即通过递归调用把整数转换为字符串。
C程序设计语言 (第二版) 练习 4-12 练习 4-12 运用printd函数的设计思想编写一个递归版本的itoa函数,即通过递归调用把整数转换为字符串。 注意:代码在win32控制台运行,在不同的IDE环境下,有部分可能需要…...