Cassandra 5.0 Spring Boot 3.3 CRUD

概览

  • 因AI要使用到向量存储,JanusGraph也使用到Cassandra

卸载先前版本

docker stop cassandra && docker remove cassandra && rm -rf cassandra/

运行Cassandra容器

docker run \--name cassandra \--hostname cassandra \-p 9042:9042 \--privileged=true \--net network-common \-v /elf/cassandra:/var/lib/cassandra \-itd cassandra:5.0.0

连接到Cassanra

# docker logs --tail 100 cassandra# 等完全启动后
# docker exec -it cassandra /bin/bash# 查询集群状态,用于应用程序连接等,详情参考Troubleshooting章节
# /opt/cassandra/bin/nodetool status# show version
[cqlsh 6.2.0 | Cassandra 5.0.0 | CQL spec 3.4.7 | Native protocol v5]# cqlsh 127.0.0.1 9042 -u cassandra -p cassandra# describe keyspaces;system       system_distributed  system_traces  system_virtual_schema
system_auth  system_schema       system_views
# /opt/cassandra/bin/nodetool statusDatacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address     Load       Tokens  Owns (effective)  Host ID                               Rack
UN  172.18.0.2  136.3 KiB  16      100.0%            63c1c77a-fa0b-4630-9fd0-9568133bd1df  rack1

Dependency

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId>
</dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-log4j2</artifactId>
</dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>

Product

import java.util.UUID;
import org.springframework.data.cassandra.core.mapping.Column;
import org.springframework.data.cassandra.core.mapping.PrimaryKey;
import org.springframework.data.cassandra.core.mapping.Table;@Table
public class Product {@PrimaryKey@Column(value = "product_id")private UUID productId;@Column(value = "product_name")private String productName;@Column(value = "product_memo")private String productMemo;@Column(value = "product_state")private boolean productState;public Product() {} public Product(UUID productId, String productName,String productMemo, boolean productState) {super();this.productId = productId;this.productName = productName;this.productMemo = productMemo;this.productState = productState;}@Overridepublic String toString() {return "Product [productId=" + productId+ ", productName=" + productName + ", productMemo=" + productMemo + ", productState=" + productState + "]";}public UUID getProductId() {return productId;}public void setProductId(UUID productId) {this.productId = productId;}public String getProductName() {return productName;}public void setProductName(String productName) {this.productName = productName;}public String getProductMemo() {return productMemo;}public void setProductMemo(String productMemo) {this.productMemo = productMemo;}public boolean isProductState() {return productState;}public void setProductState(boolean productState) {this.productState = productState;}}

ProductRepository

import java.util.List;
import java.util.UUID;
import io.os.cassandra.model.Product;
import org.springframework.data.cassandra.repository.AllowFiltering;
import org.springframework.data.cassandra.repository.CassandraRepository;
import org.springframework.stereotype.Repository;@Repository
public interface ProductRepository extends CassandraRepository<Product,UUID> {//@AllowFiltering:允许方法对服务器端筛选,等效于//select * from product where product_state = [true/false];@AllowFilteringList<Product> findByProductState(boolean productState);List<Product> findByProductMemo(String productName);
}

ProductController

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.os.cassandra.model.Product;
import io.os.cassandra.repository.ProductRepository;@RestController
@RequestMapping("/api/product")
public class ProductController {@Autowiredprivate ProductRepository productRepository;@GetMapping("/getAllProductProduct")public ResponseEntity<List<Product>> getAllProductProduct(@RequestParam(required = false,value = "productMemo") String productMemo) {try {List<Product> productList = new ArrayList<Product>();if (productMemo == null) {productRepository.findAll().forEach(productList::add);} else {productRepository.findByProductMemo(productMemo).forEach(productList::add);}if (productList.isEmpty()) {return new ResponseEntity<>(HttpStatus.NO_CONTENT);} else {return new ResponseEntity<>(productList, HttpStatus.OK);}} catch (Exception e) {return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);}}@GetMapping("/getProductById/{id}")public ResponseEntity<Product> getProductById(@PathVariable("id") String id) {var product = productRepository.findById(UUID.fromString(id));if (product.isPresent()) {return new ResponseEntity<>(product.get(), HttpStatus.OK);} else {return new ResponseEntity<>(HttpStatus.NOT_FOUND);}}@PostMapping("/createProduct")public ResponseEntity<Product> createProduct(@RequestBody Product product) {var requestProduct = new Product(UUID.randomUUID(),product.getProductName(),product.getProductMemo(),product.isProductState());try {Product p = productRepository.save(requestProduct);return new ResponseEntity<>(p,HttpStatus.CREATED);} catch (Exception e) {return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);}}@PutMapping("/updateProduct/{id}")public ResponseEntity<Product> updateProduct(@PathVariable("id") String id,@RequestBody Product product) {var updateProduct = productRepository.findById(UUID.fromString(id));if (updateProduct.isPresent()) {var p = updateProduct.get();p.setProductName(product.getProductName());p.setProductMemo(product.getProductMemo());p.setProductState(product.isProductState());return new ResponseEntity<>(productRepository.save(p), HttpStatus.OK);} else {return new ResponseEntity<>(HttpStatus.NOT_FOUND);}}@DeleteMapping("/deleteProductById/{id}")public ResponseEntity<HttpStatus> deleteProductById(@PathVariable("id") String id) {try {productRepository.deleteById(UUID.fromString(id));return new ResponseEntity<>(HttpStatus.NO_CONTENT);} catch (Exception e) {return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);}}@DeleteMapping("/deleteAllProduct")public ResponseEntity<HttpStatus> deleteAllProduct() {try {productRepository.deleteAll();return new ResponseEntity<>(HttpStatus.NO_CONTENT);} catch (Exception e) {return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);}}@GetMapping("/getProductByState")public ResponseEntity<List<Product>> findByProductState() {try {var productList = productRepository.findByProductState(true);if (productList.isEmpty()) {return new ResponseEntity<>(HttpStatus.NO_CONTENT);} else {return new ResponseEntity<>(productList, HttpStatus.OK);}} catch (Exception e) {return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);}}}

application.yaml

  • application.yaml和CassandraConfig.java,二选一
server:port: 8080servlet:context-path: /spring: data:cassandra:repositories:type: imperativecassandra:keyspace-name: elfport: 9042contact-points:- 192.168.0.123:9042schema-action: create-if-not-existspassword: cassandrausername: cassandra# /opt/cassandra/bin/nodetool status命令查询local-datacenter: datacenter1
import java.net.InetSocketAddress;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.cassandra.repository.config.EnableCassandraRepositories;
import com.datastax.oss.driver.api.core.CqlSession;@Configuration
@EnableCassandraRepositories
public class CassandraConfig {@BeanCqlSession session() {return CqlSession.builder().withKeyspace("elf").withAuthCredentials("cassandra", "cassandra").withLocalDatacenter("datacenter1").addContactPoint(InetSocketAddress.createUnresolved("192.168.0.123",9042)).build();}}

CassandraEntry

import java.lang.invoke.MethodHandles;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;@SpringBootApplication
public class CassandraEntry {public static void main(String[] sa) {var cls = MethodHandles.lookup().lookupClass();SpringApplication.run(cls,sa);}}

Environment

# cassandra为Cassandra容器名
docker start cassandra# docker exec -it cassandra /bin/bash# 查询集群状态,用于应用程序连接等,详情参考Troubleshooting章节
# /opt/cassandra/bin/nodetool status# cqlsh 127.0.0.1 9042 -u cassandra -p cassandra# describe keyspaces;

Product.cql

create keyspace if not exists elf with replication={'class':'SimpleStrategy','replication_factor':1};use elf;create table if not exists elf.product(product_id uuid primary key,product_name varchar,product_memo text,product_state boolean
);select * from elf.product;
truncate table elf.product;# 不要换行,不要随意添加空格,否则cql语法可能无法通过;
# UUID:Java UUID.randomUUID()形式,Cassandra uuid()形式;insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'JanusGraph','Graph,Open Source',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Cassandra','Wide Column,Vector,Multi Model',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Presto','Relational,Open Source,Big Data',false);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Trino','Relational,Document,Spatial,TS,KV',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Weaviate','Vector,AI,Real Time',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Milvus','Vector,Similarity Search,ML',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'Qdrant','Vector,NN,Semantic Matching',true);
insert into elf.product(product_id,product_name,product_memo,product_state)values(uuid(),'ElasticSearch','Search,Document,Spatial,Vector',true);
+--------------------------------------+-----------------------------------+---------------+--------------+
| product_id                           | product_memo                      | product_name  | product_state|
|--------------------------------------+-----------------------------------+---------------+--------------|
| 29af0738-4a17-4571-90cd-700ab8995db7 |       Vector,Similarity Search,ML |        Milvus |          True|
| 3a3415aa-8dfa-42fa-9723-0142960b687a |   Relational,Open Source,Big Data |        Presto |         False|
| 741e5240-8a7b-40fa-b07c-e88b3638bf36 |                 Graph,Open Source |    JanusGraph |          True|
| 63608ee0-eaf1-41cf-970e-04238a556103 |               Vector,AI,Real Time |      Weaviate |          True|
| 6d580a60-daba-46cc-b3d9-6061aa48f0ff |    Search,Document,Spatial,Vector | ElasticSearch |          True|
| d4760f62-9b76-4c40-8a56-8c1e7214dfdd |    Wide Column,Vector,Multi Model |     Cassandra |          True|
| ddfe8f96-c49f-4ad0-899a-9b3b484419d8 |       Vector,NN,Semantic Matching |        Qdrant |          True|
| cb99a803-2443-48ec-accb-5262ef9bc429 | Relational,Document,Spatial,TS,KV |         Trino |          True|
+--------------------------------------+-----------------------------------+---------------+--------------+

Visualization Tool

  • 安装DbVisualizer V24.1.4;

  • Tool ☞ Driver Manager ☞ 搜索Cassandra
    ☞ 右键选择Create User Driver from Template
    在这里插入图片描述

  • Name:Custom Cassandra

  • Url:jdbc:cassandra://192.168.0.123:9042

  • Driver Class:com.simba.cassandra.jdbc42.Driver

  • 点击右侧地球仪:Download/Update driver for remote artifact,
    下载完成后关闭窗口;

  • 点击左上角加号 ☞ Create Database Connection:

在这里插入图片描述

  • SQL Commander ☞ New SQL Commander ☞ select * from elf.product;

在这里插入图片描述

Create Product

  • http://localhost:8080/api/product/createProduct

  • 请求方法:POST,请求对象和响应对象分别为:

{"productName":"Cassandra","productMemo":"Wide Column,Vector,Multi Model","productState":true
}{"productId": "24672630-4ca4-424b-8fc5-c20f1400074b","productName": "Cassandra","productMemo": "Wide Column,Vector,Multi Model","productState": true
}

Update Product

  • http://localhost:8080/api/product/updateProduct/productId
    http://localhost:8080/api/product/updateProduct/24672630-4ca4-424b-8fc5-c20f1400074b

  • 请求方法:PUT,请求对象和响应对象分别为:

{"productName":"Cassandra-Update","productMemo":"Wide Column,Vector,Multi Model","productState":true
}{"productId": "24672630-4ca4-424b-8fc5-c20f1400074b","productName": "Cassandra-Update","productMemo": "Wide Column,Vector,Multi Model","productState": true
}

Retrieve By Id

  • 请求方法:GET;

  • http://localhost:8080/api/product/getProductById/productId
    http://localhost:8080/api/product/getProductById/29af0738-4a17-4571-90cd-700ab8995db7

{"productId": "29af0738-4a17-4571-90cd-700ab8995db7","productName": "Milvus","productMemo": "Vector,Similarity Search,ML","productState": true
}

Retrieve All Product

  • 请求方法:GET;

  • http://localhost:8080/api/product/getAllProductProduct

[{"productId": "29af0738-4a17-4571-90cd-700ab8995db7","productName": "Milvus","productMemo": "Vector,Similarity Search,ML","productState": true},{"productId": "3a3415aa-8dfa-42fa-9723-0142960b687a","productName": "Presto","productMemo": "Relational,Open Source,Big Data","productState": false},{"productId": "741e5240-8a7b-40fa-b07c-e88b3638bf36","productName": "JanusGraph","productMemo": "Graph,Open Source","productState": true},{"productId": "63608ee0-eaf1-41cf-970e-04238a556103","productName": "Weaviate","productMemo": "Vector,AI,Real Time","productState": true},{"productId": "6d580a60-daba-46cc-b3d9-6061aa48f0ff","productName": "ElasticSearch","productMemo": "Search,Document,Spatial,Vector","productState": true},{"productId": "d4760f62-9b76-4c40-8a56-8c1e7214dfdd","productName": "Cassandra","productMemo": "Wide Column,Vector,Multi Model","productState": true},{"productId": "ddfe8f96-c49f-4ad0-899a-9b3b484419d8","productName": "Qdrant","productMemo": "Vector,NN,Semantic Matching","productState": true},{"productId": "cb99a803-2443-48ec-accb-5262ef9bc429","productName": "Trino","productMemo": "Relational,Document,Spatial,TS,KV","productState": true}
]
  • http://localhost:8080/api/product/getAllProductProduct?productMemo=vector

  • 关于自定义索引,后续章节说明,此处不再赘述;

select * from elf.product where product_memo like '%vector%';
----[source,sql]
----
InvalidRequest: Error from server: code=2200 [Invalid query] msg="like restriction only support on properly indexed columnproduct_memo LIKE '%vector%' is not valid."

Delete Product

  • 请求方法:DELETE;

  • http://localhost:8080/api/deleteProductById/productId
    http://localhost:8080/api/deleteProductById/6d580a60-daba-46cc-b3d9-6061aa48f0ff

Delete All Product

  • 请求方法:DELETE;

  • http://localhost:8080/api/product/deleteAllProduct

Retrieve By State

  • 请求方法:GET;

  • http://localhost:8080/api/product/getProductByState

[{"productId": "29af0738-4a17-4571-90cd-700ab8995db7","productName": "Milvus","productMemo": "Vector,Similarity Search,ML","productState": true},{"productId": "741e5240-8a7b-40fa-b07c-e88b3638bf36","productName": "JanusGraph","productMemo": "Graph,Open Source","productState": true},{"productId": "63608ee0-eaf1-41cf-970e-04238a556103","productName": "Weaviate","productMemo": "Vector,AI,Real Time","productState": true},{"productId": "d4760f62-9b76-4c40-8a56-8c1e7214dfdd","productName": "Cassandra","productMemo": "Wide Column,Vector,Multi Model","productState": true},{"productId": "ddfe8f96-c49f-4ad0-899a-9b3b484419d8","productName": "Qdrant","productMemo": "Vector,NN,Semantic Matching","productState": true},{"productId": "cb99a803-2443-48ec-accb-5262ef9bc429","productName": "Trino","productMemo": "Relational,Document,Spatial,TS,KV","productState": true}
]

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

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

相关文章

【HarmonyOS】深入理解@Observed装饰器和@ObjectLink装饰器:嵌套类对象属性变化

【HarmonyOS】深入理解Observed装饰器和ObjectLink装饰器&#xff1a;嵌套类对象属性变化 前言 之前就Observed和ObjectLink写过一篇讲解博客【HarmonyOS】 多层嵌套对象通过ObjectLink和Observed实现渲染更新处理&#xff01; 其中就Observe监听类的使用&#xff0c;Object…

ZXing.Net:一个开源条码生成和识别器,支持二维码、条形码等

推荐一个跨平台的非常流行的条码库&#xff0c;方便我们在.Net项目集成条码扫描和生成功能。 01 项目简介 ZXing.Net是ZXing的.Net版本的开源库。支持跨多个平台工作&#xff0c;包括 Windows、Linux 和 macOS&#xff0c;以及在 .NET Core 和 .NET Framework 上运行。 解码…

硬件看门狗导致MCU启动时间慢

最近&#xff0c;在项目交付过程中&#xff0c;我们遇到了一个有趣的问题&#xff0c;与大家分享一下。 客户的需求是&#xff1a;在KL15电压上电后&#xff0c;MCU需要在200ms内发送出第一包CAN报文数据。然而&#xff0c;实际测试结果显示&#xff0c;软件需要360ms才能发送…

【通俗易懂介绍OAuth2.0协议以及4种授权模式】

文章目录 一.OAuth2.0协议介绍二.设计来源于生活三.关于令牌与密码的区别四.应用场景五.接下来分别简单介绍下四种授权模式吧1.客户端模式1.1 介绍1.2 适用场景1.3 时序图 2.密码模式2.1 介绍2.2 适用场景2.3时序图 3.授权码模式3.1 介绍3.2 适用场景3.3 时序图 4.简化模式4.1 …

第二百四十一节 JPA教程 - JPA一对一主键连接列示例、JPA一对一映射级联示例

JPA教程 - JPA一对一主键连接列示例 例子 下面的代码来自Person.java。 package cn.w3cschool.common; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.p…

MES系统如何提升制造企业的运营效率和灵活性

参考拓展&#xff1a;苏州稳联-西门子MES系统-赋能智能制造的核心引擎 制造执行系统(MES)在提升制造企业运营效率和灵活性方面发挥着关键作用。 一、MES系统的基本概念和功能 MES系统是连接企业管理层与生产现场的重要桥梁。它主要负责生产调度、资源管理、质量控制等多个方…

Dockerfile自定义制作镜像,其中10个指令的作用分析

docker容器中 做镜像是重要的技能。 docker commit只能制作比较简单的镜像&#xff0c; 要制作比较完善的镜像&#xff0c; 自定义程度比较高的&#xff0c; 就需要用到dockerfile dockerfile可以回溯历史 动态生成镜像。 FROM是基础镜像 CMD是在容器创建的时候默认的启动命令 …

安全热点问题

安全热点问题 1.DDOS2.补丁管理3.堡垒机管理4.加密机管理 1.DDOS 分布式拒绝服务攻击&#xff0c;是指黑客通过控制由多个肉鸡或服务器组成的僵尸网络&#xff0c;向目标发送大量看似合法的请求&#xff0c;从而占用大量网络资源使网络瘫痪&#xff0c;阻止用户对网络资源的正…

Android webview拦截H5的接口请求并返回处理好的数据

Android webview拦截H5的接口请求并返回处理好的数据 Android 可以通过 WebView 的 shouldInterceptRequest 方法拦截到 H5 中的网络请求。这是一个 WebViewClient 中的回调方法&#xff0c;允许开发者在 WebView 发起网络请求时对其进行处理和修改。 具体使用方法如下&#…

TMStarget学习——T1 Segmentation数据处理及解bug

最新学习季公俊老师的神器 TMStarget 的第一个模块基于结构像的靶区计算T1 segmentation。下面上步骤&#xff1a; (1)在github 上下载 TMStarget https://github.com/jigongjun/Neuroimaging-and-Neuromodulation (2)按照要求下载依赖工具软件AFQ、vistasoft、SPM12 &#…

OpenAI o1团队突破性论文:『过程推理』中数学推理能力大幅提升,从正确中学习的新方法

原创 超 近年来&#xff0c;大型语言模型(LLMs)在复杂的多步推理任务中取得了令人瞩目的进展。这些模型能够生成逐步的思维链&#xff0c;解决从小学数学到高等微积分的各种问题。然而&#xff0c;即使是最先进的模型也常常陷入逻辑陷阱&#xff0c;产生看似合理但实际错误的推…

只装了WPS,DOC文档无法打开

只装了WPS&#xff0c;DOC文档无法打开 打开WPS --> 全局设置 --> 设置 --> 文件格式关联 --> 与office 2007兼容 也可以选择office 2003 或 office 2010 兼容 dox文件的默认打开方式也变为WPS

1.3 计算机网络的分类

欢迎大家订阅【计算机网络】学习专栏&#xff0c;开启你的计算机网络学习之旅&#xff01; 文章目录 前言一、按分布范围分类二、按传输技术分类三、按拓扑结构分类四、按使用者分类五、按传输介质分类 前言 计算机网络根据不同的标准可以被分为多种类型&#xff0c;本章从分布…

iostat 命令:系统状态监控

一、命令简介 ​iostat ​命令用于报告系统中 CPU、磁盘、tty 设备和 CPU 利用率统计信息。 ‍ 需安装 sysstat ​软件包&#xff0c;该软件包提供了一组工具&#xff0c;包括 iostat​、sar​、mpstat ​等&#xff0c;用于系统性能监控和报告。 ‍ 二、命令参数 iostat…

STM32 MPU加速效果测试

测试代码&#xff1a; static volatile uint32_t cnt;cnt 0;uint64_t time time_spent({while (cnt < 1000000){cnt;}});log_info("test time spent: %llu us\r\n", time); 结果&#xff1a; //未开启Cache fmc_ram test: uint32_t spent time: 955963 us uin…

STM32之串口通信

什么是串口 串行通信接口&#xff1a;指按位发送和接收的接口&#xff0c;如RS232/422/485 RS232电平和COMS/TTL电平对比 RS232电平&#xff1a;逻辑1&#xff1a;-15V ~ -3V 逻辑0:3V ~ 15V CMOS电平: 逻辑1&#xff1a;3.3V 逻辑0&#xff1a;0V &#xff08;STM32使用&am…

服务注册中心对比及使用场景分析

目录 引言服务注册中心简介注册中心对比 1. Consul 1.1 介绍1.2 特性1.3 使用场景1.4 AP vs CP 2. Nacos 2.1 介绍2.2 特性2.3 使用场景2.4 AP vs CP 3. ZooKeeper 3.1 介绍3.2 特性3.3 使用场景3.4 AP vs CP 对比表格选择建议总结 引言 随着微服务架构的普及&#xff0c;服…

QT----基于QML的计时器

赶上了实习的末班车,现在在做QML开发,第一天的学习成果,一个计时器.逻辑挺简单的,纯QML实现,代码在仓库QT-Timer 学习使用c的listmodel 学习使用了如何用c的listmodel来存储数据. 新建一个TImeListModel类继承自QAbstractListModel class TimeListModel : public QAbstrac…

前端大屏自适应方案

一般后台管理页面&#xff0c;需要自适应的也就是大屏这一个&#xff0c;其他的尺寸我感觉用第三方框架继承好的就挺合适的&#xff0c;当然自适应方案也可以同步到所有页面&#xff0c;但我感觉除了 to c 的项目&#xff0c;不太需要所有页面自适应&#xff0c;毕竟都是查看和…

STM32CUBEIDE FreeRTOS操作教程(五):mutex互斥信号量

STM32CUBEIDE FreeRTOS操作教程&#xff08;五&#xff09;&#xff1a;mutex互斥信号量 STM32CUBE开发环境集成了STM32 HAL库进行FreeRTOS配置和开发的组件&#xff0c;不需要用户自己进行FreeRTOS的移植。这里介绍最简化的用户操作类应用教程。以STM32F401RCT6开发板为例&am…