当前位置: 首页 > news >正文

Java课程设计:基于Java+Swing+MySQL的图书管理系统(内附源码)

文章目录

  • 一、项目介绍
  • 二、项目展示
  • 三、源码展示
  • 四、源码获取

一、项目介绍

图书管理系统是一个常见的软件项目,广泛应用于图书馆、学校、企业等需要管理图书资源的场景。该系统通常涵盖图书信息录入、查询、借阅、归还等核心功能,是实现图书资源高效管理的重要工具。

随着信息技术的快速发展,传统纸质图书管理方式已经难以满足现代化管理的需求。图书管理系统的数字化转型成为当前图书馆和相关行业的重要发展方向。通过开发和应用图书管理系统,可以实现图书资源的数字化管理,提高工作效率,增强用户体验。

二、项目展示

登录界面
在这里插入图片描述

首页
请添加图片描述
读者查询
在这里插入图片描述
借阅图书
在这里插入图片描述
图书查询
在这里插入图片描述

三、源码展示

登录界面实现

public class LoginForm extends JFrame {private JComboBox comboBox;private JLabel title,usernamelab,passwordlab,select;private JTextField usernameField;private JPasswordField passwordField;private JButton submit,updatePwd,regist;private UserService service = new UserService();public LoginForm() {Container container = getContentPane();container.setLayout(null);submit=new JButton("登录");submit.setBounds(20,210,60,20);//登录监听submit.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {loginByUserAndPwd(e);}});regist=new JButton("注册");regist.setBounds(90,210,60,20);//跳转到注册界面regist.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {new RegistForm();}});updatePwd=new JButton("修改密码");updatePwd.setBounds(160,210,100,20);//更新密码updatePwd.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {new UpdatePwdForm();}});title=new JLabel("图书管理系统");title.setFont(new Font("宋体", Font.PLAIN, 24));title.setBounds(70,30,200,25);usernamelab=new JLabel("用户名:");usernamelab.setFont(new Font("宋体", Font.PLAIN, 16));usernamelab.setBounds(50,80,60,20);passwordlab=new JLabel("密码:");passwordlab.setFont(new Font("宋体", Font.PLAIN, 16));passwordlab.setBounds(50,120,60,20);usernameField=new JTextField();usernameField.setBounds(120,80,130,20);passwordField=new JPasswordField();passwordField.setEchoChar('*');passwordField.setBounds(120,120,130,20);container.add(title);container.add(usernamelab);container.add(usernameField);container.add(passwordlab);container.add(passwordField);container.add(submit);container.add(regist);container.add(updatePwd);//container.setBackground(Color.RED);setTitle("登录");setSize(300,300);setLocationRelativeTo(null);setResizable(false);setVisible(true);setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);}private void loginByUserAndPwd(ActionEvent e) {String username = this.usernameField.getText();String password = new String(this.passwordField.getPassword());String is_admin="";if(StringUtil.isEmpty(username)||StringUtil.isEmpty(password)){JOptionPane.showMessageDialog(null,"用户名或密码不能为空");}else {is_admin="1";//管理员User user = service.login(username, password, is_admin);if (user!=null){JOptionPane.showMessageDialog(null,"登录成功");dispose();new RootMainForm();}else {JOptionPane.showMessageDialog(null,"账号或面错误");}}}}

添加图书界面实现

public class AddBookForm extends JFrame {private JLabel bookId,bookName,bookType,translator,publishTime,stock,price,publisher,author;private JTextField bookIdField,bookNameField,translatorField,stockField,priceField,publisherField,authorField;private JButton btn_Add,btn_Cancel;private  JComboBox<String> comboBox;final JXDatePicker datepick = new JXDatePicker();public AddBookForm(){Container container = getContentPane();container.setLayout(null);btn_Add=new JButton("保存");btn_Add.setBounds(190,310,80,20);btn_Cancel=new JButton("取消");btn_Cancel.setBounds(320,310,80,20);//取消按钮监听btn_Cancel.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {dispose();}});//添加按钮监听btn_Add.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {try {addBook(e);} catch (Exception ex) {ex.printStackTrace();}}});bookId=new JLabel("图书编号");bookId.setFont(new Font("宋体", Font.PLAIN, 16));bookId.setBounds(50,50,100,20);bookType=new JLabel("图书类型");bookType.setFont(new Font("宋体", Font.PLAIN, 16));bookType.setBounds(50,90,100,20);translator=new JLabel("译者");translator.setFont(new Font("宋体", Font.PLAIN, 16));translator.setBounds(50,130,100,20);publishTime=new JLabel("出版时间");publishTime.setFont(new Font("宋体", Font.PLAIN, 16));publishTime.setBounds(50,170,100,20);stock=new JLabel("库存数量");stock.setFont(new Font("宋体", Font.PLAIN, 16));stock.setBounds(50,210,100,20);bookName=new JLabel("图书名称");bookName.setFont(new Font("宋体", Font.PLAIN, 16));bookName.setBounds(280,50,100,20);author=new JLabel("作者");author.setFont(new Font("宋体", Font.PLAIN, 16));author.setBounds(280,90,100,20);publisher=new JLabel("出版社");publisher.setFont(new Font("宋体", Font.PLAIN, 16));publisher.setBounds(280,130,100,20);price=new JLabel("定价");price.setFont(new Font("宋体", Font.PLAIN, 16));price.setBounds(280,170,100,20);bookIdField=new JTextField();bookIdField.setColumns(10);bookIdField.setBounds(120,50,130,20);String[] ty=new String[]{"文学","理学"};comboBox = new JComboBox<>(ty);comboBox.setBounds(120,90,130,20);translatorField=new JTextField();translatorField.setColumns(10);translatorField.setBounds(120,130,130,20);Date date = new Date();// 设置 date日期datepick.setDate(date);datepick.setBounds(120,170,130,20);stockField=new JTextField();stockField.setColumns(10);stockField.setBounds(120,210,130,20);bookNameField=new JTextField();bookNameField.setColumns(10);bookNameField.setBounds(360,50,130,20);authorField=new JTextField();authorField.setColumns(10);authorField.setBounds(360,90,130,20);publisherField=new JTextField();publisherField.setColumns(10);publisherField.setBounds(360,130,130,20);priceField=new JTextField();priceField.setColumns(10);priceField.setBounds(360,170,130,20);container.add(bookId);container.add(bookIdField);container.add(bookName);container.add(bookNameField);container.add(bookType);container.add(comboBox);container.add(author);container.add(authorField);container.add(translator);container.add(translatorField);container.add(publisher);container.add(publisherField);container.add(publishTime);container.add(datepick);container.add(price);container.add(priceField);container.add(stock);container.add(stockField);container.add(btn_Add);container.add(btn_Cancel);setTitle("添加图书");setSize(600,400);setLocationRelativeTo(null);setResizable(false);setVisible(true);//setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);}private void addBook(ActionEvent e) throws Exception {String bookId = this.bookIdField.getText();String bookname = this.bookNameField.getText();String booktype = (String) this.comboBox.getSelectedItem();String author = this.authorField.getText();String translator = this.translatorField.getText();String publisher = this.publisherField.getText();Date date = this.datepick.getDate();java.sql.Date publishtime = new java.sql.Date(date.getTime());float price = Float.parseFloat(this.priceField.getText());int stock = Integer.parseInt(this.stockField.getText());Book book = new Book(bookId, bookname, booktype, author, translator, publisher, publishtime, price, stock);BookService bookService = new BookService();int i=bookService.addBook(book);if (i>0){JOptionPane.showMessageDialog(null,"添加成功");dispose();}else {JOptionPane.showMessageDialog(null,"添加失败");}}

借阅图书实现

public class BorrowBookForm extends JFrame {private JLabel bookId,readerId,bookName,publisher,price,author,publishTime,stock,readerName,readerType,max_num,days_num,borrowNum,isBorrow,borrowDate,readerInfo,borrowInfo,bookInfo;private JTextField bookIdField,readerIdField,bookNameField,authorField,publisherField,publishTimeField,priceField,stockField,readerNameField,readerTypeField,max_numField,days_numField,borrowNumField,isBorrowField;private JButton btn_Check,btn_Borrow,btn_Close;private BorrowService borrowService=new BorrowService();private ReaderService readerService=new ReaderService();final JXDatePicker datepick1,datepick2;public BorrowBookForm() {Container container = getContentPane();container.setLayout(null);btn_Check=new JButton("查询");btn_Check.setBounds(450,20,60,20);btn_Borrow=new JButton("借出");btn_Borrow.setBounds(200,410,60,20);btn_Close=new JButton("关闭");btn_Close.setBounds(300,410,60,20);btn_Close.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {dispose();}});btn_Check.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {checkReaderIdAndBookId(e);}});btn_Borrow.addActionListener(new ActionListener() {@Overridepublic void actionPerformed(ActionEvent e) {borrowBook(e);}});bookId=new JLabel("图书编号");bookId.setFont(new Font("宋体", Font.PLAIN, 16));bookId.setBounds(50,20,100,20);readerId=new JLabel("读者编号");readerId.setFont(new Font("宋体", Font.PLAIN, 16));readerId.setBounds(250,20,100,20);bookInfo=new JLabel("--------------------------图书信息--------------------------");bookInfo.setFont(new Font("宋体", Font.PLAIN, 16));bookInfo.setBounds(50,55,500,20);bookName=new JLabel("图书名称:");bookName.setFont(new Font("宋体", Font.PLAIN, 16));bookName.setBounds(50,80,100,20);author=new JLabel("作者:");author.setFont(new Font("宋体", Font.PLAIN, 16));author.setBounds(350,80,100,20);publisher=new JLabel("出版社:");publisher.setFont(new Font("宋体", Font.PLAIN, 16));publisher.setBounds(50,110,100,20);publishTime=new JLabel("出版时间:");publishTime.setFont(new Font("宋体", Font.PLAIN, 16));;publishTime.setBounds(350,110,100,20);price=new JLabel("订价:");price.setFont(new Font("宋体", Font.PLAIN, 16));price.setBounds(50,140,100,20);stock=new JLabel("库存量:");stock.setFont(new Font("宋体", Font.PLAIN, 16));stock.setBounds(350,140,100,20);readerInfo=new JLabel("--------------------------读者信息--------------------------");readerInfo.setFont(new Font("宋体", Font.PLAIN, 16));readerInfo.setBounds(50,170,500,20);readerName=new JLabel("读者姓名:");readerName.setFont(new Font("宋体", Font.PLAIN, 16));readerName.setBounds(50,195,100,20);readerType=new JLabel("读者类型:");readerType.setFont(new Font("宋体", Font.PLAIN, 16));readerType.setBounds(350,195,100,20);max_num=new JLabel("最大可借数:");max_num.setFont(new Font("宋体", Font.PLAIN, 16));max_num.setBounds(50,220,100,20);days_num=new JLabel("最大可借天数:");days_num.setFont(new Font("宋体", Font.PLAIN, 16));days_num.setBounds(350,220,130,20);borrowInfo=new JLabel("--------------------------借阅信息--------------------------");borrowInfo.setFont(new Font("宋体", Font.PLAIN, 16));borrowInfo.setBounds(50,250,500,20);/*** 文本框*/bookIdField=new JTextField();bookIdField.setBounds(120,20,100,20);readerIdField=new JTextField();readerIdField.setBounds(320,20,100,20);bookNameField=new JTextField();bookNameField.setEditable(false);bookNameField.setBounds(140,80,100,20);authorField=new JTextField();authorField.setEditable(false);authorField.setBounds(430,80,100,20);publisherField=new JTextField();publisherField.setEditable(false);publisherField.setBounds(140,110,100,20);//出版时间Date date = new Date();// 设置 date日期datepick1= new JXDatePicker();datepick1.setDate(date);datepick1.setEditable(false);datepick1.setBounds(430,110,100,20);priceField=new JTextField();priceField.setEditable(false);priceField.setBounds(140,140,110,20);stockField=new JTextField();stockField.setEditable(false);stockField.setBounds(430,140,100,20);readerNameField=new JTextField();readerNameField.setEditable(false);readerNameField.setBounds(140,195,100,20);readerTypeField=new JTextField();readerTypeField.setEditable(false);readerTypeField.setBounds(430,195,100,20);max_numField=new JTextField();max_numField.setEditable(false);max_numField.setBounds(140,220,100,20);days_numField=new JTextField();days_numField.setEditable(false);days_numField.setBounds(470,220,60,20);borrowNumField=new JTextField();borrowNumField.setEditable(false);borrowNumField.setBounds(210,275,100,20);isBorrowField=new JTextField();isBorrowField.setEditable(false);isBorrowField.setBounds(250,300,100,20);//借阅日期Date date2 = new Date();// 设置 date日期datepick2= new JXDatePicker();datepick2.setDate(date2);datepick2.setBounds(140,325,100,20);/*** 借阅者文本框*/borrowNum=new JLabel("该读书已借图书数量:");borrowNum.setFont(new Font("宋体", Font.PLAIN, 16));borrowNum.setBounds(50,275,200,20);isBorrow=new JLabel("该读者是否可借所选图书:");isBorrow.setFont(new Font("宋体", Font.PLAIN, 16));isBorrow.setBounds(50,300,200,20);borrowDate=new JLabel("借阅日期:");borrowDate.setFont(new Font("宋体", Font.PLAIN, 16));borrowDate.setBounds(50,325,100,20);/*** 添加到容器*/container.add(bookId);container.add(bookIdField);container.add(readerId);container.add(readerIdField);container.add(btn_Check);container.add(bookInfo);container.add(bookName);container.add(bookNameField);container.add(author);container.add(authorField);container.add(publisher);container.add(publisherField);container.add(publishTime);container.add(datepick1);container.add(price);container.add(priceField);container.add(stock);container.add(stockField);container.add(readerInfo);container.add(readerName);container.add(readerNameField);container.add(readerType);container.add(readerTypeField);container.add(max_num);container.add(max_numField);container.add(days_num);container.add(days_numField);container.add(borrowInfo);container.add(borrowNum);container.add(borrowNumField);container.add(isBorrow);container.add(isBorrowField);container.add(borrowDate);container.add(datepick2);container.add(btn_Borrow);container.add(btn_Close);setTitle("借阅图书");setSize(600,500);setLocationRelativeTo(null);setResizable(false);setVisible(true);//setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);}private void borrowBook(ActionEvent e) {//获取图书字段String bookId = bookIdField.getText();//获取库存量int stock = Integer.parseInt(this.stockField.getText());//获取已借数量int outloan = Integer.parseInt(borrowNumField.getText());//获取最大可借数int maxnum= Integer.parseInt(max_numField.getText());//获取读者idint readerId = Integer.parseInt(readerIdField.getText());//获取天数int daysNum = Integer.parseInt(days_numField.getText());//获取当前日期Date date = this.datepick2.getDate();java.sql.Date borrowDate = new java.sql.Date(date.getTime());//指定归还日期Calendar cal = Calendar.getInstance();cal.add(Calendar.DATE, daysNum);Date newDate = cal.getTime();//设置借书和还书的标识String if_back="";Borrow borrow=borrowService.findBorrowById(readerId, bookId);System.out.println(borrow);if (borrow==null){if_back="1";Borrow borrowAdd = new Borrow(bookId,readerId,borrowDate,new java.sql.Date(newDate.getTime()),if_back);int i=borrowService.addBorrowDate(borrowAdd);if (i>0){//每次借阅+1;outloan++;//最大可借数-1;maxnum--;//库存-1stock--;if (stock<=0){this.btn_Borrow.setEnabled(false);}else {BookService bookService = new BookService();Book book = new Book(bookId,stock,outloan);Reader reader = new Reader(readerId,maxnum);ReaderService readerService = new ReaderService();//更新读者可借的最大数量int i2 = readerService.updateReaderMaxnum(reader);//更新库存量和已借数量int i1 = bookService.updateBookStockAndOutloan(book);borrowService.addBookandRead(bookId,readerId);if (i1>0&&i2>0){//更新后设置库存文本框stockField.setText(String.valueOf(book.getStock()));borrowNumField.setText(String.valueOf(book.getOutloan()));max_numField.setText(String.valueOf(reader.getMax_num()));JOptionPane.showMessageDialog(null,"借出成功");dispose();}}}else {JOptionPane.showMessageDialog(null,"借出失败");}}}//连表查询图书和读者信息private void checkReaderIdAndBookId(ActionEvent e) {String bookId = bookIdField.getText();int readerId = Integer.parseInt(readerIdField.getText());//System.out.println(readerId);ReaderBorrowBook rbb=borrowService.findBorrowBybookIdAndreaderId(bookId,readerId);//System.out.println(rbb);if (rbb!=null){bookNameField.setText(rbb.getBookname());//书名authorField.setText(rbb.getAuthor());//作者publisherField.setText(rbb.getPublisher());//出版社datepick1.setDate(rbb.getPublish_time());//出版日期priceField.setText(String.valueOf(rbb.getPricce()));//价格stockField.setText(String.valueOf(rbb.getStock()));//库存readerNameField.setText(rbb.getReadername());//读者名readerTypeField.setText(rbb.getReadertype());//读者类型max_numField.setText(String.valueOf(rbb.getMax_num()));//最大借书量days_numField.setText(String.valueOf(rbb.getDays_num()));//最大借书天数borrowNumField.setText(String.valueOf(rbb.getOutloan()));//已借书数量Borrow borrow=borrowService.findBorrowById(readerId, bookId);System.out.println(borrow);if (rbb.getMax_num()<=0){isBorrowField.setText("无法再借图书");//不能点击借书按钮btn_Borrow.setEnabled(false);}else {//可以点击借书按钮btn_Borrow.setEnabled(true);}if (borrow==null){isBorrowField.setText("是");btn_Borrow.setEnabled(true);}else {//判读是1还是0,从而判断是否被借还是归还if (borrow.getIf_back().equals("1")){isBorrowField.setText("否");datepick2.setDate(borrow.getBorrowDate());btn_Borrow.setEnabled(false);}else if (borrow.getIf_back().equals("0")){isBorrowField.setText("是");btn_Borrow.setEnabled(true);}}}}
}

四、源码获取

源码已经打包了,点击下面蓝色链接获取!

点我获取源码

相关文章:

Java课程设计:基于Java+Swing+MySQL的图书管理系统(内附源码)

文章目录 一、项目介绍二、项目展示三、源码展示四、源码获取 一、项目介绍 图书管理系统是一个常见的软件项目,广泛应用于图书馆、学校、企业等需要管理图书资源的场景。该系统通常涵盖图书信息录入、查询、借阅、归还等核心功能,是实现图书资源高效管理的重要工具。 随着信…...

WireGuard网络架构及配置详解

WireGuard网络架构及配置详解 一.点对点二.中心网关,实现nat穿透弊端:流量全部经过中心网关,带宽上限受限于中心网关 三.借助registry实现双向nat穿透需要借助registry实现 udp打洞, 待二开 一.点对点 yum install epel-release elrepo-release -y yum install yum-plugin-elr…...

VB.NET实现上位机自动识别可用串口

在实际应用中有时会牵扯到挑选可用串口&#xff0c;比如上位机和从站设备使用Modbus RTU协议进行通讯时需要选择COM串口&#xff0c;每次启动连接前都在设备管理器查看较为麻烦&#xff0c;可以设置一个串口自动识别功能&#xff0c;如果选择了错误的串口还可以提示串口选择错误…...

Node.js版本管理工具-NVM

在开发 Node.js 项目时&#xff0c;经常会遇到需要切换不同版本的 Node.js 的情况。为了方便管理和切换各个版本&#xff0c;我们可以使用一些 Node.js 版本管理工具。 Node Version Manager&#xff1a;简称NVM&#xff0c;最流行的 Node.js 版本管理工具之一。它允许我们在同…...

【react】useEffect 快速上手

useEffect 快速上手 useEffect(setup, dependencies?) 可以接收两个参数&#xff0c;分别是回调函数与依赖数组. useEffect 用什么姿势来调用&#xff0c;本质上取决于你想用它来达成什么样的效果。下面我们来简单介绍 useEffect 的调用规则。 每一次渲染后都执行的副作用&a…...

docker容器部署jenkins

提前安装好jdk和maven&#xff0c;jdk最好使用11版本&#xff0c;jdk-11.0.10 docker run -u root -d \ -p 100:8080 \ -v /var/jenkins_home/workspace/:/var/jenkins_home/workspace/ \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /usr/bin/docker:/usr/bin/docker…...

第十四章 享元模式

目录 1 享元模式介绍 2 享元模式原理 3 享元模式实现 4 享元模式应用实例 5 享元模式总结 1 享元模式介绍 享元模式 (flyweight pattern) 的原始定义是&#xff1a;摒弃了在每个对象中保存所有数据的方式&#xff0c;通过共享多个对象所共有的相同状态&#xff0c;从而让我…...

ThinkBook 16 2024 Ubuntu 触控板问题解决

sudo insmod goodix-gt7868q.ko sudo cp local-overrides.quirks /etc/libinput/local-overrides.quirks sudo systemctl restart gdm 有偿解决&#xff0c;无效退款...

qt qDebug兼容LOGE

目录 普通qDebug用法 qt qDebug兼容LOGE 模板参数2实现 qDebug 实现LOGE一样的用法,这样Android和qt同时支持LOGE打印日志 普通qDebug用法 #include <QApplication> #include <QDebug>int main(int argc, char *argv[]) {QApplication app(argc, argv);int ret…...

【Ardiuno】实验使用ESP32单片机连接Wifi(图文)

ESP32单片机最为精华和有特色的地方当然是wifi连接&#xff0c;这里我们就写程序实验一下适使用ESP32主板连接wifi&#xff0c;为了简化实验我们这里只做了连接部分&#xff0c;其他实验在后续再继续。 由于本实验只要在串口监视器中查看结果状态即可&#xff0c;因此电路板上…...

常用的五大数据可视化工具测评分享

随着数据驱动决策的时代到来&#xff0c;数据可视化工具成为了企业提升数据分析效率和决策质量的关键工具。本文将对帆软BI、奥威BI、思迈特BI、永洪BI以及亿信华辰BI这五大数据可视化工具进行详细的操作体验测评&#xff0c;总结它们的特点和优势。 一、帆软BI 帆软BI作为国…...

什么是校园抄表系统?

1.校园抄表系统的简述 校园抄表系统是当代高校管理中的一个重要组成部分&#xff0c;主要运用于全自动搜集、管理方法与分析校园里的电力能源使用数据&#xff0c;如水电煤等。它通过先进的方式方法&#xff0c;完成了对能源消耗的实时监控系统&#xff0c;提升了电力能源管理…...

计算机专业:未来何去何从?

💝💝💝欢迎来到我的博客,很高兴能够在这里和您见面!希望您在这里可以感受到一份轻松愉快的氛围,不仅可以获得有趣的内容和知识,也可以畅所欲言、分享您的想法和见解。 推荐:kwan 的首页,持续学习,不断总结,共同进步,活到老学到老导航 檀越剑指大厂系列:全面总结 jav…...

python-windows10普通笔记本跑bert mrpc数据样例0.1.048

python-windows10普通笔记本跑bert mrpc数据样例0.1.000 背景参考章节获取数据下载bert模型下载bert代码windows10的cpu进行训练进行预测注意事项TODOLIST背景 看了介绍说可以在gpu或者tpu上去微调,当前没环境,所以先在windows10上跑一跑,看是否能顺利进行,目标就是训练的…...

4句话明白虚拟机和容器的区别

一、虚拟机VM的组成 服务器-HostOS-虚拟化层-GustOS-libs-App 1、此时存在几个问题&#xff1a; 1、资源消耗大 2、扩展APP副本时到重复资源浪费&#xff08;GustOS-libs&#xff09; 3、当你开发在本地但要移植到云端&#xff0c;就会出现各种兼容性问题。 4、很难集成到DevOp…...

Django render()函数页面渲染

1&#xff0c; render() 函数 在Django框架中&#xff0c;render() 函数是一个非常有用的快捷方式&#xff0c;用于从视图函数返回一个完整的HTTP响应。它负责将给定的模板与上下文数据结合&#xff0c;渲染出最终的HTML页面&#xff0c;并返回一个HttpResponse对象。 from d…...

基于webrtc的媒体流传输工具tl-rtc-file

也不知道是什么意思&#xff0c;天天都有人在微信公众号的后台发&#xff0c;是打算找我兑奖吗&#xff1f; 本文软件是朋友 Eduna 推荐的&#xff0c;因为他觉得好像很好玩的样子。老苏一开始以为 tl-rtc-file 是跟 Snapdrop 一样的局域网文件传输工具&#xff0c;在看了 demo…...

【最新鸿蒙应用开发】——类Web开发范式2——前端语法

兼容JS的类Web开发范式 JS FA应用的JS模块(entry/src/main/js/module)的典型开发目录结构如下&#xff1a; 1. 项目基本结构 1.1. 目录结构 1.2. 项目文件分类如下&#xff1a; .hml结尾的HML模板文件&#xff0c;这个文件用来描述当前页面的文件布局结构。 .css结尾的CSS样…...

前端的强缓存和协商缓存

前端缓存机制 前端缓存主要分为两种类型&#xff1a;强缓存和协商缓存。 强缓存&#xff08;HTTP Cache-Control&#xff09; 通过设置HTTP响应头中的Cache-Control实现。浏览器根据Cache-Control的值决定是否重新请求资源。指令示例&#xff1a; no-cache&#xff1a;重新验…...

JSON如何处理包含特殊字符的字段

在JSON中处理包含特殊字符的字段时&#xff0c;你通常不需要直接处理这些特殊字符&#xff0c;因为JSON格式本身就会对特殊字符进行转义。当你使用编程语言或工具来生成或解析JSON时&#xff0c;这些转义通常是自动处理的。 然而&#xff0c;如果你需要手动处理或理解这些转义…...

conda相比python好处

Conda 作为 Python 的环境和包管理工具&#xff0c;相比原生 Python 生态&#xff08;如 pip 虚拟环境&#xff09;有许多独特优势&#xff0c;尤其在多项目管理、依赖处理和跨平台兼容性等方面表现更优。以下是 Conda 的核心好处&#xff1a; 一、一站式环境管理&#xff1a…...

STM32标准库-DMA直接存储器存取

文章目录 一、DMA1.1简介1.2存储器映像1.3DMA框图1.4DMA基本结构1.5DMA请求1.6数据宽度与对齐1.7数据转运DMA1.8ADC扫描模式DMA 二、数据转运DMA2.1接线图2.2代码2.3相关API 一、DMA 1.1简介 DMA&#xff08;Direct Memory Access&#xff09;直接存储器存取 DMA可以提供外设…...

第25节 Node.js 断言测试

Node.js的assert模块主要用于编写程序的单元测试时使用&#xff0c;通过断言可以提早发现和排查出错误。 稳定性: 5 - 锁定 这个模块可用于应用的单元测试&#xff0c;通过 require(assert) 可以使用这个模块。 assert.fail(actual, expected, message, operator) 使用参数…...

Module Federation 和 Native Federation 的比较

前言 Module Federation 是 Webpack 5 引入的微前端架构方案&#xff0c;允许不同独立构建的应用在运行时动态共享模块。 Native Federation 是 Angular 官方基于 Module Federation 理念实现的专为 Angular 优化的微前端方案。 概念解析 Module Federation (模块联邦) Modul…...

uniapp微信小程序视频实时流+pc端预览方案

方案类型技术实现是否免费优点缺点适用场景延迟范围开发复杂度​WebSocket图片帧​定时拍照Base64传输✅ 完全免费无需服务器 纯前端实现高延迟高流量 帧率极低个人demo测试 超低频监控500ms-2s⭐⭐​RTMP推流​TRTC/即构SDK推流❌ 付费方案 &#xff08;部分有免费额度&#x…...

图表类系列各种样式PPT模版分享

图标图表系列PPT模版&#xff0c;柱状图PPT模版&#xff0c;线状图PPT模版&#xff0c;折线图PPT模版&#xff0c;饼状图PPT模版&#xff0c;雷达图PPT模版&#xff0c;树状图PPT模版 图表类系列各种样式PPT模版分享&#xff1a;图表系列PPT模板https://pan.quark.cn/s/20d40aa…...

听写流程自动化实践,轻量级教育辅助

随着智能教育工具的发展&#xff0c;越来越多的传统学习方式正在被数字化、自动化所优化。听写作为语文、英语等学科中重要的基础训练形式&#xff0c;也迎来了更高效的解决方案。 这是一款轻量但功能强大的听写辅助工具。它是基于本地词库与可选在线语音引擎构建&#xff0c;…...

Angular微前端架构:Module Federation + ngx-build-plus (Webpack)

以下是一个完整的 Angular 微前端示例&#xff0c;其中使用的是 Module Federation 和 npx-build-plus 实现了主应用&#xff08;Shell&#xff09;与子应用&#xff08;Remote&#xff09;的集成。 &#x1f6e0;️ 项目结构 angular-mf/ ├── shell-app/ # 主应用&…...

苹果AI眼镜:从“工具”到“社交姿态”的范式革命——重新定义AI交互入口的未来机会

在2025年的AI硬件浪潮中,苹果AI眼镜(Apple Glasses)正在引发一场关于“人机交互形态”的深度思考。它并非简单地替代AirPods或Apple Watch,而是开辟了一个全新的、日常可接受的AI入口。其核心价值不在于功能的堆叠,而在于如何通过形态设计打破社交壁垒,成为用户“全天佩戴…...

【堆垛策略】设计方法

堆垛策略的设计是积木堆叠系统的核心&#xff0c;直接影响堆叠的稳定性、效率和容错能力。以下是分层次的堆垛策略设计方法&#xff0c;涵盖基础规则、优化算法和容错机制&#xff1a; 1. 基础堆垛规则 (1) 物理稳定性优先 重心原则&#xff1a; 大尺寸/重量积木在下&#xf…...