spring security + oauth2 使用RedisTokenStore 以json格式存储

1.项目架构

 2.自己对 TokenStore 的 redis实现

package com.enterprise.auth.config;import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.Cursor;
import org.springframework.data.redis.core.ScanOptions;
import org.springframework.security.oauth2.common.ExpiringOAuth2RefreshToken;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.common.OAuth2RefreshToken;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.security.oauth2.provider.token.AuthenticationKeyGenerator;
import org.springframework.security.oauth2.provider.token.DefaultAuthenticationKeyGenerator;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.redis.JdkSerializationStrategy;
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStoreSerializationStrategy;
import org.springframework.util.ClassUtils;
import org.springframework.util.ReflectionUtils;import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.util.*;public class MyRedisTokenStore implements TokenStore {private static final String ACCESS = "access:";private static final String AUTH_TO_ACCESS = "auth_to_access:";private static final String AUTH = "auth:";private static final String REFRESH_AUTH = "refresh_auth:";private static final String ACCESS_TO_REFRESH = "access_to_refresh:";private static final String REFRESH = "refresh:";private static final String REFRESH_TO_ACCESS = "refresh_to_access:";private static final String CLIENT_ID_TO_ACCESS = "client_id_to_access:";private static final String UNAME_TO_ACCESS = "uname_to_access:";private static final boolean springDataRedis_2_0 = ClassUtils.isPresent("org.springframework.data.redis.connection.RedisStandaloneConfiguration", RedisTokenStore.class.getClassLoader());private final RedisConnectionFactory connectionFactory;private AuthenticationKeyGenerator authenticationKeyGenerator = new DefaultAuthenticationKeyGenerator();private RedisTokenStoreSerializationStrategy serializationStrategy = new MyRedisTokenStoreSerializationStrategy();private String prefix = "";private Method redisConnectionSet_2_0;public MyRedisTokenStore(RedisConnectionFactory connectionFactory) {this.connectionFactory = connectionFactory;if (springDataRedis_2_0) {this.loadRedisConnectionMethods_2_0();}}public void setAuthenticationKeyGenerator(AuthenticationKeyGenerator authenticationKeyGenerator) {this.authenticationKeyGenerator = authenticationKeyGenerator;}public void setSerializationStrategy(RedisTokenStoreSerializationStrategy serializationStrategy) {this.serializationStrategy = serializationStrategy;}public void setPrefix(String prefix) {this.prefix = prefix;}private void loadRedisConnectionMethods_2_0() {this.redisConnectionSet_2_0 = ReflectionUtils.findMethod(RedisConnection.class, "set", new Class[]{byte[].class, byte[].class});}private RedisConnection getConnection() {return this.connectionFactory.getConnection();}private byte[] serialize(Object object) {return this.serializationStrategy.serialize(object);}private byte[] serializeKey(String object) {return this.serialize(this.prefix + object);}private OAuth2AccessToken deserializeAccessToken(byte[] bytes) {return (OAuth2AccessToken)this.serializationStrategy.deserialize(bytes, OAuth2AccessToken.class);}private OAuth2Authentication deserializeAuthentication(byte[] bytes) {return (OAuth2Authentication)this.serializationStrategy.deserialize(bytes, OAuth2Authentication.class);}private OAuth2RefreshToken deserializeRefreshToken(byte[] bytes) {return (OAuth2RefreshToken)this.serializationStrategy.deserialize(bytes, OAuth2RefreshToken.class);}private byte[] serialize(String string) {return this.serializationStrategy.serialize(string);}private String deserializeString(byte[] bytes) {return this.serializationStrategy.deserializeString(bytes);}public OAuth2AccessToken getAccessToken(OAuth2Authentication authentication) {String key = this.authenticationKeyGenerator.extractKey(authentication);byte[] serializedKey = this.serializeKey("auth_to_access:" + key);byte[] bytes = null;RedisConnection conn = this.getConnection();try {bytes = conn.get(serializedKey);} finally {conn.close();}OAuth2AccessToken accessToken = this.deserializeAccessToken(bytes);if (accessToken != null) {OAuth2Authentication storedAuthentication = this.readAuthentication(accessToken.getValue());if (storedAuthentication == null || !key.equals(this.authenticationKeyGenerator.extractKey(storedAuthentication))) {this.storeAccessToken(accessToken, authentication);}}return accessToken;}public OAuth2Authentication readAuthentication(OAuth2AccessToken token) {return this.readAuthentication(token.getValue());}public OAuth2Authentication readAuthentication(String token) {byte[] bytes = null;RedisConnection conn = this.getConnection();try {bytes = conn.get(this.serializeKey("auth:" + token));} finally {conn.close();}OAuth2Authentication var4 = this.deserializeAuthentication(bytes);return var4;}public OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token) {return this.readAuthenticationForRefreshToken(token.getValue());}public OAuth2Authentication readAuthenticationForRefreshToken(String token) {RedisConnection conn = this.getConnection();OAuth2Authentication var5;try {byte[] bytes = conn.get(this.serializeKey("refresh_auth:" + token));OAuth2Authentication auth = this.deserializeAuthentication(bytes);var5 = auth;} finally {conn.close();}return var5;}public void storeAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication) {byte[] serializedAccessToken = this.serialize((Object)token);byte[] serializedAuth = this.serialize((Object)authentication);byte[] accessKey = this.serializeKey("access:" + token.getValue());byte[] authKey = this.serializeKey("auth:" + token.getValue());byte[] authToAccessKey = this.serializeKey("auth_to_access:" + this.authenticationKeyGenerator.extractKey(authentication));byte[] approvalKey = this.serializeKey("uname_to_access:" + getApprovalKey(authentication));byte[] clientId = this.serializeKey("client_id_to_access:" + authentication.getOAuth2Request().getClientId());RedisConnection conn = this.getConnection();try {conn.openPipeline();if (springDataRedis_2_0) {try {this.redisConnectionSet_2_0.invoke(conn, accessKey, serializedAccessToken);this.redisConnectionSet_2_0.invoke(conn, authKey, serializedAuth);this.redisConnectionSet_2_0.invoke(conn, authToAccessKey, serializedAccessToken);} catch (Exception var24) {throw new RuntimeException(var24);}} else {conn.set(accessKey, serializedAccessToken);conn.set(authKey, serializedAuth);conn.set(authToAccessKey, serializedAccessToken);}if (!authentication.isClientOnly()) {conn.sAdd(approvalKey, new byte[][]{serializedAccessToken});}conn.sAdd(clientId, new byte[][]{serializedAccessToken});if (token.getExpiration() != null) {int seconds = token.getExpiresIn();conn.expire(accessKey, (long)seconds);conn.expire(authKey, (long)seconds);conn.expire(authToAccessKey, (long)seconds);conn.expire(clientId, (long)seconds);conn.expire(approvalKey, (long)seconds);}OAuth2RefreshToken refreshToken = token.getRefreshToken();if (refreshToken != null && refreshToken.getValue() != null) {byte[] refresh = this.serialize(token.getRefreshToken().getValue());byte[] auth = this.serialize(token.getValue());byte[] refreshToAccessKey = this.serializeKey("refresh_to_access:" + token.getRefreshToken().getValue());byte[] accessToRefreshKey = this.serializeKey("access_to_refresh:" + token.getValue());if (springDataRedis_2_0) {try {this.redisConnectionSet_2_0.invoke(conn, refreshToAccessKey, auth);this.redisConnectionSet_2_0.invoke(conn, accessToRefreshKey, refresh);} catch (Exception var23) {throw new RuntimeException(var23);}} else {conn.set(refreshToAccessKey, auth);conn.set(accessToRefreshKey, refresh);}if (refreshToken instanceof ExpiringOAuth2RefreshToken) {ExpiringOAuth2RefreshToken expiringRefreshToken = (ExpiringOAuth2RefreshToken)refreshToken;Date expiration = expiringRefreshToken.getExpiration();if (expiration != null) {int seconds = Long.valueOf((expiration.getTime() - System.currentTimeMillis()) / 1000L).intValue();conn.expire(refreshToAccessKey, (long)seconds);conn.expire(accessToRefreshKey, (long)seconds);}}}conn.closePipeline();} finally {conn.close();}}private static String getApprovalKey(OAuth2Authentication authentication) {String userName = authentication.getUserAuthentication() == null ? "" : authentication.getUserAuthentication().getName();return getApprovalKey(authentication.getOAuth2Request().getClientId(), userName);}private static String getApprovalKey(String clientId, String userName) {return clientId + (userName == null ? "" : ":" + userName);}public void removeAccessToken(OAuth2AccessToken accessToken) {this.removeAccessToken(accessToken.getValue());}public OAuth2AccessToken readAccessToken(String tokenValue) {byte[] key = this.serializeKey("access:" + tokenValue);byte[] bytes = null;RedisConnection conn = this.getConnection();try {bytes = conn.get(key);} finally {conn.close();}OAuth2AccessToken var5 = this.deserializeAccessToken(bytes);return var5;}public void removeAccessToken(String tokenValue) {byte[] accessKey = this.serializeKey("access:" + tokenValue);byte[] authKey = this.serializeKey("auth:" + tokenValue);byte[] accessToRefreshKey = this.serializeKey("access_to_refresh:" + tokenValue);RedisConnection conn = this.getConnection();try {conn.openPipeline();conn.get(accessKey);conn.get(authKey);conn.del(new byte[][]{accessKey});conn.del(new byte[][]{accessToRefreshKey});conn.del(new byte[][]{authKey});List<Object> results = conn.closePipeline();byte[] access = (byte[])((byte[])results.get(0));byte[] auth = (byte[])((byte[])results.get(1));OAuth2Authentication authentication = this.deserializeAuthentication(auth);if (authentication != null) {String key = this.authenticationKeyGenerator.extractKey(authentication);byte[] authToAccessKey = this.serializeKey("auth_to_access:" + key);byte[] unameKey = this.serializeKey("uname_to_access:" + getApprovalKey(authentication));byte[] clientId = this.serializeKey("client_id_to_access:" + authentication.getOAuth2Request().getClientId());conn.openPipeline();conn.del(new byte[][]{authToAccessKey});conn.sRem(unameKey, new byte[][]{access});conn.sRem(clientId, new byte[][]{access});conn.del(new byte[][]{this.serialize("access:" + key)});conn.closePipeline();}} finally {conn.close();}}public void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication) {byte[] refreshKey = this.serializeKey("refresh:" + refreshToken.getValue());byte[] refreshAuthKey = this.serializeKey("refresh_auth:" + refreshToken.getValue());byte[] serializedRefreshToken = this.serialize((Object)refreshToken);RedisConnection conn = this.getConnection();try {conn.openPipeline();if (springDataRedis_2_0) {try {this.redisConnectionSet_2_0.invoke(conn, refreshKey, serializedRefreshToken);this.redisConnectionSet_2_0.invoke(conn, refreshAuthKey, this.serialize((Object)authentication));} catch (Exception var13) {throw new RuntimeException(var13);}} else {conn.set(refreshKey, serializedRefreshToken);conn.set(refreshAuthKey, this.serialize((Object)authentication));}if (refreshToken instanceof ExpiringOAuth2RefreshToken) {ExpiringOAuth2RefreshToken expiringRefreshToken = (ExpiringOAuth2RefreshToken)refreshToken;Date expiration = expiringRefreshToken.getExpiration();if (expiration != null) {int seconds = Long.valueOf((expiration.getTime() - System.currentTimeMillis()) / 1000L).intValue();conn.expire(refreshKey, (long)seconds);conn.expire(refreshAuthKey, (long)seconds);}}conn.closePipeline();} finally {conn.close();}}public OAuth2RefreshToken readRefreshToken(String tokenValue) {byte[] key = this.serializeKey("refresh:" + tokenValue);byte[] bytes = null;RedisConnection conn = this.getConnection();try {bytes = conn.get(key);} finally {conn.close();}OAuth2RefreshToken var5 = this.deserializeRefreshToken(bytes);return var5;}public void removeRefreshToken(OAuth2RefreshToken refreshToken) {this.removeRefreshToken(refreshToken.getValue());}public void removeRefreshToken(String tokenValue) {byte[] refreshKey = this.serializeKey("refresh:" + tokenValue);byte[] refreshAuthKey = this.serializeKey("refresh_auth:" + tokenValue);byte[] refresh2AccessKey = this.serializeKey("refresh_to_access:" + tokenValue);byte[] access2RefreshKey = this.serializeKey("access_to_refresh:" + tokenValue);RedisConnection conn = this.getConnection();try {conn.openPipeline();conn.del(new byte[][]{refreshKey});conn.del(new byte[][]{refreshAuthKey});conn.del(new byte[][]{refresh2AccessKey});conn.del(new byte[][]{access2RefreshKey});conn.closePipeline();} finally {conn.close();}}public void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken) {this.removeAccessTokenUsingRefreshToken(refreshToken.getValue());}private void removeAccessTokenUsingRefreshToken(String refreshToken) {byte[] key = this.serializeKey("refresh_to_access:" + refreshToken);List<Object> results = null;RedisConnection conn = this.getConnection();try {conn.openPipeline();conn.get(key);conn.del(new byte[][]{key});results = conn.closePipeline();} finally {conn.close();}if (results != null) {byte[] bytes = (byte[])((byte[])results.get(0));String accessToken = this.deserializeString(bytes);if (accessToken != null) {this.removeAccessToken(accessToken);}}}private List<byte[]> getByteLists(byte[] approvalKey, RedisConnection conn) {Long size = conn.sCard(approvalKey);List<byte[]> byteList = new ArrayList(size.intValue());Cursor cursor = conn.sScan(approvalKey, ScanOptions.NONE);while(cursor.hasNext()) {Object next = cursor.next();byteList.add(next.toString().getBytes(StandardCharsets.UTF_8));}return byteList;}public Collection<OAuth2AccessToken> findTokensByClientIdAndUserName(String clientId, String userName) {byte[] approvalKey = this.serializeKey("uname_to_access:" + getApprovalKey(clientId, userName));List<byte[]> byteList = null;RedisConnection conn = this.getConnection();try {byteList = this.getByteLists(approvalKey, conn);} finally {conn.close();}if (byteList != null && byteList.size() != 0) {List<OAuth2AccessToken> accessTokens = new ArrayList(byteList.size());Iterator var7 = byteList.iterator();while(var7.hasNext()) {byte[] bytes = (byte[])var7.next();OAuth2AccessToken accessToken = this.deserializeAccessToken(bytes);accessTokens.add(accessToken);}return Collections.unmodifiableCollection(accessTokens);} else {return Collections.emptySet();}}public Collection<OAuth2AccessToken> findTokensByClientId(String clientId) {byte[] key = this.serializeKey("client_id_to_access:" + clientId);List<byte[]> byteList = null;RedisConnection conn = this.getConnection();try {byteList = this.getByteLists(key, conn);} finally {conn.close();}if (byteList != null && byteList.size() != 0) {List<OAuth2AccessToken> accessTokens = new ArrayList(byteList.size());Iterator var6 = byteList.iterator();while(var6.hasNext()) {byte[] bytes = (byte[])var6.next();OAuth2AccessToken accessToken = this.deserializeAccessToken(bytes);accessTokens.add(accessToken);}return Collections.unmodifiableCollection(accessTokens);} else {return Collections.emptySet();}}
}

3.自定义序列化类

package com.enterprise.auth.config;import com.google.gson.Gson;
import org.springframework.security.oauth2.provider.token.store.redis.BaseRedisTokenStoreSerializationStrategy;import java.nio.charset.StandardCharsets;
import java.util.Map;public class MyRedisTokenStoreSerializationStrategy extends BaseRedisTokenStoreSerializationStrategy {@Override//反序列化内部protected <T> T deserializeInternal(byte[] bytes, Class<T> aClass) {String s = new String(bytes);Gson gson = new Gson();return gson.fromJson(s,aClass);}@Override//反序列化字符串内部protected String deserializeStringInternal(byte[] bytes) {return new String(bytes);}@Override//序列化内部protected byte[] serializeInternal(Object o) {Gson gson = new Gson();String json = gson.toJson(o);return json.getBytes(StandardCharsets.UTF_8);}@Override//序列化内部protected byte[] serializeInternal(String s) {return  s.getBytes(StandardCharsets.UTF_8);}
}

4.配置使用redis类型的 TokenStore

package com.enterprise.auth.config;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.security.oauth2.provider.token.TokenStore;@Configuration
public class MyRedisTokenStoreConfig {@Autowiredprivate RedisConnectionFactory redisConnectionFactory;@Beanpublic TokenStore tokenStore() {MyRedisTokenStore redisTokenStore = new MyRedisTokenStore(redisConnectionFactory);return redisTokenStore;}
}

5.完成认证模块的编写后,测试登录

 

 json已经保存在数据库了

但是!!!!!,保存没问题,取出来的时候就有问题了,把这三个文件复制到资源服务器,让资源服务器也用MyRedisTokenStore 的方式读取权限信息.

 然后访问,到json权限信息转成实体类的时候,就有问题了,各种各样oauth2 中的数据实体类,没有构造方法,无法创建对象,先转成map在手动新建对象同样不行,

 redis中的配置已经读到了

 但是需要实例化的对象类路径,这么长一串,没有构造方法,无法新建对象.

报错>>>

 

结束<<<<<<<<

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/78524.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

基于SpringBoot+Vue的漫画网站设计与实现(源码+LW+部署文档等)

博主介绍&#xff1a; 大家好&#xff0c;我是一名在Java圈混迹十余年的程序员&#xff0c;精通Java编程语言&#xff0c;同时也熟练掌握微信小程序、Python和Android等技术&#xff0c;能够为大家提供全方位的技术支持和交流。 我擅长在JavaWeb、SSH、SSM、SpringBoot等框架…

41.利用matlab 平衡方程用于图像(matlab程序)

1.简述 白平衡 白平衡的英文为White Balance&#xff0c;其基本概念是“不管在任何光源下&#xff0c;都能将白色物体还原为白色”&#xff0c;对在特定光源下拍摄时出现的偏色现象&#xff0c;通过加强对应的补色来进行补偿。 所谓的白平衡是通过对白色被摄物的颜色还原&…

opencv-34 图像平滑处理-双边滤波cv2.bilateralFilter()

双边滤波&#xff08;BilateralFiltering&#xff09;是一种图像处理滤波技术&#xff0c;用于平滑图像并同时保留边缘信息。与其他传统的线性滤波方法不同&#xff0c;双边滤波在考虑像素之间的空间距离之外&#xff0c;还考虑了像素之间的灰度值相似性。这使得双边滤波能够有…

【C语言进阶】指针的高级应用(下)

文章目录 一、指针数组与数组指针1.1 指针数组与数组指针的表达式 二、函数指针2.1 函数指针的书写方式 三、二重指针与一重指针3.1 二重指针的本质3.2 二重指针的用法3.3 二重指针与数组指针 总结 一、指针数组与数组指针 (1)指针数组的实质是一个数组&#xff0c;这个数组中存…

【python】使用Selenium和Chrome WebDriver来获取 【腾讯云 Cloud Studio 实战训练营】中的文章信息

文章目录 前言导入依赖库设置ChromeDriver的路径创建Chrome WebDriver对象打开网页找到结果元素创建一个空列表用于存储数据遍历结果元素并提取数据提取标题、作者、发布时间等信息判断是否为目标文章提取目标文章的描述、阅读数量、点赞数量、评论数量等信息将提取的数据存储为…

IntelliJ IDEA 2023.2 最新变化

IntelliJ IDEA 2023.2 引入 AI Assistant&#xff0c;通过一组由 AI 提供支持的功能助力开发。 升级的 IntelliJ 分析器现在提供编辑器内提示&#xff0c;使分析进程更加直观详尽。 此版本还包括有助于简化开发工作流的 GitLab 集成&#xff0c;以及其他多项值得关注的更新和改…

在政策+市场双轮驱动下,深眸科技助力机器视觉行业走向成熟

近年来&#xff0c;随着人工智能发展的不断提速&#xff0c;机器视觉作为其重要的前沿分支&#xff0c;凭借着机器代替人眼来做测量和判断的能力&#xff0c;广泛应用于工业领域的制造生产环节&#xff0c;用来保证产品质量、控制生产流程、感知环境等&#xff0c;并迸发出强劲…

基于新浪微博海量用户行为数据、博文数据数据分析:包括综合指数、移动指数、PC指数三个指数

基于新浪微博海量用户行为数据、博文数据数据分析&#xff1a;包括综合指数、移动指数、PC指数三个指数 项目介绍 微指数是基于海量用户行为数据、博文数据&#xff0c;采用科学计算方法统计得出的反映不同事件领域发展状况的指数产品。微指数对于收录的关键词&#xff0c;在指…

用Log4j 2记录日志

说明 maven工程中增加对Log4j 2的依赖 下面代码示例的maven工程中的pom.xml文件中需要增加对Log4j 2的依赖&#xff1a; <dependency><groupId>org.apache.logging.log4j</groupId><artifactId>log4j-core</artifactId><version>2.20.0&…

【C语言学习】整数的输入输出、八进制和十六进制

一、整数的输入输出 只有两种形式&#xff1a;int或long long %d:int %u:unsigned %ld:long long %lu:unsigned long long 二、八进制和十六进制 以0开头就是八进制&#xff0c;以0x开头就是十六进制。 无论是八进制还是十六进制只是如何将数字表达为字符串&#xff0c;但计…

UML-构件图

目录 1.概述 2.构件的类型 3.构件和类 4.构件图 1.概述 构件图主要用于描述各种软件之间的依赖关系&#xff0c;例如&#xff0c;可执行文件和源文件之间的依赖关系&#xff0c;所设计的系统中的构件的表示法及这些构件之间的关系构成了构件图 构件图从软件架构的角度来描述…

Vue2 第二十节 vue-router (四)

1.全局前置路由和后置路由 2.独享路由守卫 3.组件内路由守卫 4.路由器的两种工作模式 路由 作用&#xff1a;对路由进行权限控制 分类&#xff1a;全局守卫&#xff0c;独享守卫&#xff0c;组件内守卫 一.全局前置路由和后置路由 ① 前置路由守卫&#xff1a;每次路由…

《每天5分钟玩转kubernetes》读书笔记

笔记 概念 Pod是脆弱的&#xff0c;但应用是健壮的。 kubelet运行在Cluster所有节点上&#xff0c;负责启动Pod和容器。kubeadm用于初始化Cluster。kubectl是k8s命令行工具。通过kubectl可以部署和管理应用&#xff0c;查看各种资源&#xff0c;创建、删除和更新各种组件。 …

python使用虚拟环境安装第三方模块和运行python脚本

1、在用户家目录下创建一个名为env38的虚拟环境 python3 -m venv env38 创建虚拟环境env38后的目录 2、 激活虚拟环境 source ~/env38/bin/activate 3、安装pyqt5 pip install pyqt5 4、写一个简单的python脚本 import sys print(sys.path)# 如果执行成功&#xff0c;没有…

Unity Shader编辑器工具类ShaderUtil 常用函数和用法

Unity Shader编辑器工具类ShaderUtil 常用函数和用法 Unity的Shader编辑器工具类ShaderUtil提供了一系列函数&#xff0c;用于编译、导入和管理着色器。本文将介绍ShaderUtil类中的常用函数和用法。 编译和导入函数 CompileShader 函数签名&#xff1a;public static bool C…

CAD随机球体颗粒过渡区3D插件

插件介绍 CAD随机球体颗粒&过渡区3D插件可用于在AutoCAD软件内生成随机分布的球体及球体外侧过渡区部件&#xff0c;适用于科研绘图、有限元建模如混凝土细观、颗粒增强复合材料、随机三维骨料及过渡区等方面的应用。 插件可指定的参数有模型的长、宽、高&#xff1b;球…

如何将 dubbo filter 拦截器原理运用到日志拦截器中?

业务背景 我们希望可以在使用日志拦截器时&#xff0c;定义属于自己的拦截器方法。 实现的方式有很多种&#xff0c;我们分别来看一下。 拓展阅读 java 注解结合 spring aop 实现自动输出日志 java 注解结合 spring aop 实现日志traceId唯一标识 java 注解结合 spring ao…

概念解析 | PointNet概述

注1:本文系“概念解析”系列之一,致力于简洁清晰地解释、辨析复杂而专业的概念。本次解析的概念是:点云深度学习及PointNet论文概述 参考论文:Qi C R, Su H, Mo K, et al. Pointnet: Deep learning on point sets for 3d classification and segmentation[C]//Proceedings of …

yum出现Could not retrieve mirrorlist解决方法

Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org/?release6&archi386&repoos error was 14: PYCURL ERROR 6 - “Couldn’t resolve host ‘mirrorlist.centos.org…

Linux进程(二)

文章目录 进程&#xff08;二&#xff09;Linux的进程状态R &#xff08;running&#xff09;运行态S &#xff08;sleeping&#xff09;阻塞状态D &#xff08;disk sleep&#xff09;深度睡眠T&#xff08;stopped&#xff09;状态X&#xff08;dead&#xff09;状态Z&#x…