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

SpringMVC_SSM整合

一、回顾SpringMVC访问接口流程

1.容器加载分析

  • 容器分析

    在这里插入图片描述

  • 手动注册WebApplicationContext

    public class ServletConfig extends AbstractDispatcherServletInitializer {@Overrideprotected WebApplicationContext createServletApplicationContext() {//获取SpringMVC容器AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();context.register(SpringMvcConfig.class);return context;}@Overrideprotected String[] getServletMappings() {return new String[]{"/"};}@Overrideprotected WebApplicationContext createRootApplicationContext() {return null;}
    }
    

2.容器加载过程分析

  • tomcat 服务器启动的时候,加载ServletConfig类之后,做初始化web容器操作,相当于 web.xml

  • 执行注册容器的方法,获取 SpringMVC容器 WebApplicationContext

    @Nullableprotected WebApplicationContext createRootApplicationContext() {Class<?>[] configClasses = this.getRootConfigClasses();if (!ObjectUtils.isEmpty(configClasses)) {AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();context.register(configClasses);return context;} else {return null;}}protected WebApplicationContext createServletApplicationContext() {AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();Class<?>[] configClasses = this.getServletConfigClasses();if (!ObjectUtils.isEmpty(configClasses)) {context.register(configClasses);}return context;}
    
  • 通过@ComponentScan(“cn.sycoder.controller”) 加载 Controller 下面的bean 进 WebApplicationContext

    @RestController
    public class TestController {@GetMapping("/test/{id}")public String test(@PathVariable Long id) {return "ok:" + id;}
    }
    
  • 把使用了 RequestMapping 注解的方法的 value — 对应一个方法,建立起了一对一映射关系(可以想象hashmap)

    • /test/{id} ---- test 方法

3.请求接口过程

  • 访问 http://localhost:8082/test/1
  • 匹配 springmvc 的 / servletMapping 规则,交给 springmvc 处理
  • 解析 /test/1路径找到对应的 test 方法
  • 执行方法
  • 因为使用 RestController ,所以返回方法的返回值作为响应体返回给浏览器

4.SSM整合会出现bean界定不清楚问题

  • SpringMVC 需要加载哪些bean?
    • controller 层(表现层即可)
  • Spring 加载哪些bean?
    • service
    • dao

4.1如何处理

  • 将spring配置注入到 web 容器中

    @Configuration
    @ComponentScan(value={"cn.sycoder.service","cn.sycoder.dao"})
    public class SpringConfig {
    }
    public class ServletConfig  extends AbstractAnnotationConfigDispatcherServletInitializer {@Overrideprotected Class<?>[] getRootConfigClasses() {return new Class[]{SpringConfig.class};}@Overrideprotected Class<?>[] getServletConfigClasses() {return new Class[]{SpringMvcConfig.class};}@Overrideprotected String[] getServletMappings() {return new String[]{"/"};}
    }
    

4.2验证两个容器的bean相互不干扰

  • 验证代码

    @Test
    public void test(){AnnotationConfigApplicationContext applicationContext =new AnnotationConfigApplicationContext(SpringConfig.class);ITestService bean = applicationContext.getBean(ITestService.class);bean.get(1L);TestController bean1 = applicationContext.getBean(TestController.class);System.out.println(bean1.test(1L));
    }
    

二、SSM整合

1.SSM整合流程分析

  • 概述SSM:Spring SpringMVC Mybatis

1.1创建工程

  • 导入依赖

    • ssm 所需要的依赖包
  • 配置 web 项目入口配置替换 web.xml(AbstractAnnotationConfigDispatcherServletInitializer)

    • 配置 Spring 配置类交给 web 容器管理

      @Overrideprotected Class<?>[] getRootConfigClasses() {return new Class[]{SpringConfig.class};}
      
    • 配置 SpringMVC 配置类交给 web 容器管理

      @Overrideprotected Class<?>[] getServletConfigClasses() {return new Class[]{SpringMvcConfig.class};}
      
    • 配置请求拦截规则,交给 springmvc 处理

      @Overrideprotected String[] getServletMappings() {return new String[]{"/"};}
      

1.2配置 Spring

  • SpringConfig
    • @Configuration 标记Spring配置类,替换Spring-config-xml
    • @ComponetScan 扫描需要被Spring 管理的bean
    • @EnableTransactionManagment 启动管理事务支持
    • @PropertySource 引入db.properties 配置文件
  • 配置 JdbcConfig 配置类
    • 使用德鲁伊 DataSource 数据源
    • 构建平台事务管理器 DataSourceTransactionManager
  • 配置 MyBatis 配置类
    • 构建 SqlSessionFactoryBean
    • 指定 MapperScanner 设置 mapper 包扫描寻找 mapper.xml 文件

1.3配置 SpringMVC

  • 配置SpringMvcConfig
    • @Configuration
    • @ComponentScan 只扫描 Controller
    • 开启SpringMVC 注解支持 @EnableWebMvc

1.4开发业务

  • 使用注解
    • 注入bean 注解
      • @Autowired
    • @RestController
      • @GetMapping
        • @RequestParam
      • @PostMapping
        • @RequestBody
      • @DeleteMapping
        • @PathVariable
      • @PutMapping
    • @Service
      • @Transactional
    • junit
      • @RunWith
      • @ContextConfiguration
      • @Test

2.SSM整合

2.1导入依赖

  • 依赖

    <dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>5.2.17.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-jdbc</artifactId><version>5.2.17.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-test</artifactId><version>5.2.17.RELEASE</version></dependency><dependency><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId><version>3.5.6</version></dependency><dependency><groupId>org.mybatis</groupId><artifactId>mybatis-spring</artifactId><version>1.3.0</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.29</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>1.1.16</version></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version><scope>test</scope></dependency><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version><scope>provided</scope></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.9.0</version></dependency></dependencies>
    

2.2创建各目录结构

  • 目录如下

    在这里插入图片描述

2.3创建SpringConfig

  • SpringConfig(在整合项目的时候不能扫描mvc的类,否则会出现创建容器失败)

    @Configuration
    @ComponentScan(value = {"cn.sycoder.service","cn.sycoder.dao"})
    @EnableTransactionManagement
    @PropertySource("classpath:db.properties")
    @Import({DbConfig.class,MybatisConfig.class})
    public class SpringConfig {
    }
    

2.4创建DbConfig配置类

  • 创建数据库配置文件

    jdbc.url=jdbc:mysql://localhost:3306/ssm
    jdbc.driver=com.mysql.cj.jdbc.Driver
    jdbc.username=root
    jdbc.password=123456
    
  • 创建DbConfig

    public class DbConfig {@Value("${jdbc.url}")private String url;@Value("${jdbc.driver}")private String driver;@Value("${jdbc.username}")private String username;@Value("${jdbc.password}")private String password;/*** 配置德鲁伊连接池* @return*/@Beanpublic DataSource dataSource(){DruidDataSource source = new DruidDataSource();source.setUrl(url);source.setDriverClassName(driver);source.setPassword(password);source.setUsername(username);return source;}@Beanpublic PlatformTransactionManager transactionManager(DataSource dataSource){DataSourceTransactionManager manager = new DataSourceTransactionManager();manager.setDataSource(dataSource);return manager;}}
    

2.5创建MybatisConfig配置类

  • MyBatisConfig

    public class MybatisConfig {@Beanpublic SqlSessionFactoryBean sessionFactoryBean(DataSource dataSource){SqlSessionFactoryBean bean = new SqlSessionFactoryBean();bean.setDataSource(dataSource);bean.setTypeAliasesPackage("cn.sycoder.domain");return bean;}@Beanpublic MapperScannerConfigurer mapperScannerConfigurer(){MapperScannerConfigurer configurer = new MapperScannerConfigurer();configurer.setBasePackage("cn.sycoder.dao");return configurer;}
    }
    

2.6创建SpringMVC配置类

  • SpringMvcConfig

    @Configuration
    @ComponentScan("cn.sycoder.controller")
    @EnableWebMvc
    public class SpringMvcConfig {
    }
    

2.7创建Web项目入口配置类

  • ServletConfig

    public class ServletConfig extends AbstractAnnotationConfigDispatcherServletInitializer {@Overrideprotected Class<?>[] getRootConfigClasses() {return new Class[]{SpringConfig.class};//配置Spring交给Web 管理}@Overrideprotected Class<?>[] getServletConfigClasses() {return new Class[]{SpringMvcConfig.class};}@Overrideprotected String[] getServletMappings() {return new String[]{"/"};}
    }
    

3.功能开发

3.1创建数据库及表

  • 创建 ssm 数据库

  • 创建 item 表

    create table item
    (id bigint auto_increment,type varchar(64) null,name varchar(64) null,remark text null,constraint item_pkprimary key (id)
    );

3.2编写模型类

  • 添加 lombok 依赖

    <dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.22</version>
    </dependency>
    
  • 模型类

    @Data
    public class Item {private Long id;private String name;private String type;private String remark;
    }
    

3.3编写Mapper接口

  • Mapper 接口

    @Repository
    public interface ItemMapper {@Insert("insert into item(name,type,remark) value(#{name},#{type},#{remark})")public int save(Item item);@Delete("delete from item where id = #{id}")public int delete(Long id);@Update("update item set name = #{name},type = #{type},remark=#{remark} where id=#{id}")public int update(Item item);@Select("select * from item where id = #{id}")public Item getById(Long id);@Select("select * from item")public List<Item> list();}
    

3.4编写Service接口和实现类

  • Service 接口

    public interface IItemService {/*** 添加闲置物品方法* @param item* @return*/public boolean save(Item item);/*** 删除闲置物品* @param id* @return*/public boolean delete(Long id);/*** 更新闲置物品* @param item* @return*/public boolean update(Item item);/*** 查询闲置物品通过id* @param id* @return*/public Item getById(Long id);/*** 查询所有闲置商品* @return*/public List<Item> lists();
    }
    
  • 定义接口实现类

    @Service
    public class ItemServiceImpl implements IItemService {@AutowiredItemMapper mapper;@Override@Transactionalpublic boolean save(Item item) {return mapper.save(item) > 0;}@Override@Transactionalpublic boolean delete(Long id) {return mapper.delete(id) >0;}@Override@Transactionalpublic boolean update(Item item) {return mapper.update(item) >0;}@Overridepublic Item getById(Long id) {return mapper.getById(id);}@Overridepublic List<Item> lists() {return mapper.list();}
    }
    

3.5编写Contorller类

  • Controller

    @RestController
    @RequestMapping("/item")
    public class ItemController {@AutowiredIItemService service;@PostMappingpublic boolean save(@RequestBody Item item){return service.save(item);}@PutMappingpublic boolean update(@RequestBody Item item){return service.update(item);}@DeleteMapping("/{id}")public boolean delete(@PathVariable Long id){return service.delete(id);}@GetMapping("/{id}")public Item getById(@PathVariable Long id){return service.getById(id);}@GetMappingpublic List<Item> list(){return service.lists();}
    }
    

4.验证 ssm 整合结果

  • 启动项目并且解决问题

    在这里插入图片描述

  • 修改Spring配置类

    @Configuration
    @ComponentScan(value = {"cn.sycoder.service","cn.sycoder.dao"})
    @EnableTransactionManagement
    @PropertySource("classpath:db.properties")
    @Import({DbConfig.class,MybatisConfig.class})
    public class SpringConfig {
    }
    

4.1添加item 数据

  • 准备 item 数据

    {"name":"键盘","type":"电脑外设","remark":"9成新,半价卖"}
    
    {"name":"笔记本","type":"电脑","remark":"9成新,8折出售"}
    
    {"name":"鞋子","type":"收藏鞋","remark":"科比签名的,独一无二"}
    
  • 添加数据

    在这里插入图片描述

4.2修改数据

  • 准备数据

    {"id":4,"name":"二手鞋子","type":"废鞋","remark":"破鞋子"}
    
  • 修改操作

    在这里插入图片描述

4.3查询单个数据

  • 查询id=4的物品

    在这里插入图片描述

4.4删除单个数据

  • 删除id=4的物品

    在这里插入图片描述

4.5查询全部数据操作

  • 查询全部

    在这里插入图片描述

5.整合单元测试

  • 目录结构

    在这里插入图片描述

  • 新建测试类

    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration(classes = SpringConfig.class)
    public class ItemTest {@AutowiredIItemService service;@Testpublic void save(){Item item = new Item();item.setName("单元测试");item.setRemark("单元测试");item.setType("单元测试");boolean save = service.save(item);System.out.println(save);}@Testpublic void update(){Item item = new Item();item.setId(5L);item.setName("单元测试");item.setRemark("单元测试");item.setType("单元测试");boolean save = service.update(item);System.out.println(save);}@Testpublic void getById(){Item byId = service.getById(5L);System.out.println(byId);}@Testpublic void list(){List<Item> lists = service.lists();System.out.println(lists);}
    }
    

三、项目实战中细节问题

1.导入前端资源

1.1静态资源拦截处理

  • 设置访问 index 访问主页

    @Controller
    public class IndexController {@RequestMapping("/index")public String index(){System.out.println("----------------");return "/pages/items.html";}}
    
  • 出现静态资源被拦截问题

    @Configuration
    public class StaticSupport extends WebMvcConfigurationSupport {@Overrideprotected void addResourceHandlers(ResourceHandlerRegistry registry) {registry.addResourceHandler("/pages/**").addResourceLocations("/pages/");registry.addResourceHandler("/js/**").addResourceLocations("/js/");registry.addResourceHandler("/css/**").addResourceLocations("/css/");registry.addResourceHandler("/plugins/**").addResourceLocations("/plugins/");}
    }
    
  • 将 staticSupport 交给 SpringMvc 管理

    @Configuration
    @ComponentScan(value = {"cn.sycoder.controller","cn.sycoder.config"})
    @EnableWebMvc
    public class SpringMvcConfig {
    }
    

1.2项目实现

  • 保存方法

    handleAdd () {console.log("========")axios.post("/item",this.formData).then((res)=>{//todo})
    },
    
  • 列表查询

    getAll() {axios.get("/item",).then((res)=>{this.dataList = res.data;})
    },
    
  • 删除操作

    handleDelete(row) {axios.delete("/item/"+row.id).then((res)=>{//todo})
    }
    

相关文章:

SpringMVC_SSM整合

一、回顾SpringMVC访问接口流程 1.容器加载分析 容器分析 手动注册WebApplicationContext public class ServletConfig extends AbstractDispatcherServletInitializer {Overrideprotected WebApplicationContext createServletApplicationContext() {//获取SpringMVC容器An…...

【操作系统】电脑上没有IIS怎么办

文章目录 前言一、查看二、解决 前言 有的新机刚开始在计算机-管理-服务下没有IIS网络服务怎么办。 一、查看 桌面计算机/此电脑 鼠标右键&#xff1a;管理 服务和应用 发现没有IIS 二、解决 控制面板 程序和功能 启动或关闭Windows功能 IIS相关的所有功能选中&#xff…...

【vue】vue项目中批量下载文件并打压缩包

前言 一开始用的是循环单个文件下载&#xff0c;即从后台获取到文件url列表&#xff0c;循环对每个url单独进行下载&#xff0c;这样的问题是每调用一次下载&#xff0c;浏览器都会进行“另存为”的弹框&#xff0c;很麻烦&#xff01;&#xff01;&#xff01; 关闭“下载前…...

Linux中的软件管家——yum

目录 ​编辑 一&#xff0c;软件安装的方式 二&#xff0c;对yum的介绍 1.yum的作用 2&#xff0c;yum的库 三&#xff0c;yum下载软件的操作 1.yumlist 2.yuminstall 3.yumremove 四&#xff0c;yum源的转换 一&#xff0c;软件安装的方式 软件安装的方式大概分为三种…...

安卓绘制原理概览

绘制原理 Android 程序员都知道 Android 的绘制流程分为 Measure、Layout、Draw 三步骤&#xff0c;其中 Measure 负责测量 View 的大小Layout 负责确定 View 的位置Draw 负责将 View 画在屏幕上 由 ViewRootImpl 实现的 performTraversal 方法是 Measure、layout、draw 的真正…...

接口测试工具开发文档

1 开发规划 1.1 开发人员 角 色 主要职责 负责模块 人员 备注 n xxx模块 xxx 1.2 开发计划 <附开发计划表> 1.3 开发环境和工具 开发工具 工具 作用 Notepad 编辑器 Perl 解释器 2 总体设计 设计思路&#xff1a;因为测试app和server。首先必须…...

面试题速记:JavaScript有哪些数据类型,它们的区别是?

JavaScript有哪些数据类型&#xff0c;它们的区别&#xff1f; JavaScript共有八种数据类型&#xff0c;分别是 Undefined、Null、Boolean、Number、String、Object、Symbol、BigInt。 其中 Symbol 和 BigInt 是ES6 中新增的数据类型&#xff1a; ●Symbol 代表创建后独一无二…...

Spring Cloud面试题

为什么需要学习Spring Cloud 不论是商业应用还是用户应用&#xff0c;在业务初期都很简单&#xff0c;我们通常会把它实现为单体结构的应用。但是&#xff0c;随着业务逐渐发展&#xff0c;产品思想会变得越来越复杂&#xff0c;单体结构的应用也会越来越复杂。这就会给应用带…...

计算机网络自顶向下-web页面请求历程

1. 准备: DHCP、 UDP、 IP 和以太网 假定 Bob 启动他的便携机&#xff0c;然后将其用一根以太网电缆连接到学校的以太网交换机 &#xff0c; 交换机与学校的路由器相连。学校的路由器与一个 ISP 连接&#xff0c; 本例中 ISP 为 comcast.net &#xff0c;为学校提供了 DNS 服务…...

打造西南交通感知新范式,闪马智能携手首讯科技落地创新中心

9月4日&#xff0c;2023年中国国际智能产业博览会&#xff08;以下简称“智博会”&#xff09;在重庆拉开帷幕。大会期间&#xff0c;由上海闪马智能科技有限公司&#xff08;以下简称“闪马智能”&#xff09;与重庆首讯科技股份有限公司&#xff08;以下简称“首讯科技”&…...

Android11去掉Settings中的网络和互联网一级菜单

碰到一个不要wifi不要蓝牙的项目&#xff0c;客户要求去掉Settings中的网络和互联网一级菜单&#xff0c;因为硬件都不贴&#xff0c;所以软件对应也要去掉。 我们可以根据packages/apps/Settings/res/xml/top_level_settings.xml的布局文件找到TopLevelNetworkEntryPreferenc…...

基于Python开发的五子棋小游戏(源码+可执行程序exe文件+程序配置说明书+程序使用说明书)

一、项目简介 本项目是一套基于Python开发的五子棋小游戏&#xff0c;主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的Python学习者。 包含&#xff1a;项目源码、项目文档、数据库脚本等&#xff0c;该项目附带全部源码可作为毕设使用。 项目都经过严格调试&a…...

JDBC入门到精通-10w总结

JDBC核心技术 笔记是以尚硅谷讲师宋红康JDBC课程为基础&#xff0c;加入自身学习体会&#xff0c;略有修改 第1章&#xff1a;JDBC概述 JDBC是java应用程序和数据库之间的桥梁。JDBC提供一组规范&#xff08;接口&#xff09;。向上是面向应用API&#xff0c;共应用程序使用。向…...

Linux之查看so/bin依赖(三十一)

简介&#xff1a; CSDN博客专家&#xff0c;专注Android/Linux系统&#xff0c;分享多mic语音方案、音视频、编解码等技术&#xff0c;与大家一起成长&#xff01; 优质专栏&#xff1a;Audio工程师进阶系列【原创干货持续更新中……】&#x1f680; 人生格言&#xff1a; 人生…...

day-45 代码随想录算法训练营(19)动态规划 part 07

70.爬楼梯&#xff08;进阶&#xff09; 分析&#xff1a;基本动态规划转换为完全背包&#xff0c;因为1、2 两种上楼梯方式是无限选择的 思路&#xff1a; 1. j 表示 容量为 j 时&#xff0c;装满有dp[j]种方法2. dp[j]dp[j-nums[i]]3. 初始化 dp[0]1,dp[1]14. 遍历顺序&am…...

static关键字和final关键字

在java的关键字中&#xff0c;static关键字和final关键字是两个必须掌握的关键字。static关键字和final关键字用法多样&#xff0c;且在一定环境下使用&#xff0c;可以提高程序的运行性能&#xff0c;优化程序的结构。下面将依次介绍static关键字和final关键字。注意&#xff…...

使用Postman如何在接口测试前将请求的参数进行自定义处理

1、前言 当我们使用 Postman 进行接口测试时&#xff0c;对于简单的不需要处理的接口&#xff0c;直接请求即可&#xff0c;但是对于需要处理的接口&#xff0c;如需要转码、替换值等&#xff0c;则就麻烦一些&#xff0c;一般我们都是先手动把修改好的值拷贝到请求里再进行请…...

QT第二天

1.优化登陆界面&#xff0c;当点击登录按钮后&#xff0c;在该按钮对应的槽函数中&#xff0c;判断账户和密码框内的数据是否为admin和123456&#xff0c;如果账户密码匹配成功&#xff0c;则提示登陆成功并关闭登录界面&#xff0c;如果账户密码匹配失败&#xff0c;则提示登录…...

鸿蒙应用程序入口UIAbility详解

一、UIAbility概述 UIAbility是一种包含用户界面的应用组件&#xff0c;主要用于和用户进行交互。UIAbility也是系统调度的单元&#xff0c;为应用提供窗口在其中绘制界面。每一个UIAbility实例&#xff0c;都对应于一个最近任务列表中的任务。一个应用可以有一个UIAbility&am…...

扫地僧站群·静态养站王:自动万站智能LOGO功能说明

扫地僧站群静态养站王:自动万站智能LOGO功能说明,无需配置,自动根据网站状态生成对应LOGO&#xff0c;高质量LOGO万站不重样.说明&#xff1a;模板调用智能LOGO方式&#xff1a;{当前域名}/logo.png 自动识别HTTP/HTTPS 只需在模板需要展示LOGO的地方放上如上标签即可。以下为L…...

vue3 定时器-定义全局方法 vue+ts

1.创建ts文件 路径&#xff1a;src/utils/timer.ts 完整代码&#xff1a; import { onUnmounted } from vuetype TimerCallback (...args: any[]) > voidexport function useGlobalTimer() {const timers: Map<number, NodeJS.Timeout> new Map()// 创建定时器con…...

【Java_EE】Spring MVC

目录 Spring Web MVC ​编辑注解 RestController RequestMapping RequestParam RequestParam RequestBody PathVariable RequestPart 参数传递 注意事项 ​编辑参数重命名 RequestParam ​编辑​编辑传递集合 RequestParam 传递JSON数据 ​编辑RequestBody ​…...

3403. 从盒子中找出字典序最大的字符串 I

3403. 从盒子中找出字典序最大的字符串 I 题目链接&#xff1a;3403. 从盒子中找出字典序最大的字符串 I 代码如下&#xff1a; class Solution { public:string answerString(string word, int numFriends) {if (numFriends 1) {return word;}string res;for (int i 0;i &…...

多模态大语言模型arxiv论文略读(108)

CROME: Cross-Modal Adapters for Efficient Multimodal LLM ➡️ 论文标题&#xff1a;CROME: Cross-Modal Adapters for Efficient Multimodal LLM ➡️ 论文作者&#xff1a;Sayna Ebrahimi, Sercan O. Arik, Tejas Nama, Tomas Pfister ➡️ 研究机构: Google Cloud AI Re…...

智能仓储的未来:自动化、AI与数据分析如何重塑物流中心

当仓库学会“思考”&#xff0c;物流的终极形态正在诞生 想象这样的场景&#xff1a; 凌晨3点&#xff0c;某物流中心灯火通明却空无一人。AGV机器人集群根据实时订单动态规划路径&#xff1b;AI视觉系统在0.1秒内扫描包裹信息&#xff1b;数字孪生平台正模拟次日峰值流量压力…...

SiFli 52把Imagie图片,Font字体资源放在指定位置,编译成指定img.bin和font.bin的问题

分区配置 (ptab.json) img 属性介绍&#xff1a; img 属性指定分区存放的 image 名称&#xff0c;指定的 image 名称必须是当前工程生成的 binary 。 如果 binary 有多个文件&#xff0c;则以 proj_name:binary_name 格式指定文件名&#xff0c; proj_name 为工程 名&…...

基于Java+MySQL实现(GUI)客户管理系统

客户资料管理系统的设计与实现 第一章 需求分析 1.1 需求总体介绍 本项目为了方便维护客户信息为了方便维护客户信息&#xff0c;对客户进行统一管理&#xff0c;可以把所有客户信息录入系统&#xff0c;进行维护和统计功能。可通过文件的方式保存相关录入数据&#xff0c;对…...

Python基于历史模拟方法实现投资组合风险管理的VaR与ES模型项目实战

说明&#xff1a;这是一个机器学习实战项目&#xff08;附带数据代码文档&#xff09;&#xff0c;如需数据代码文档可以直接到文章最后关注获取。 1.项目背景 在金融市场日益复杂和波动加剧的背景下&#xff0c;风险管理成为金融机构和个人投资者关注的核心议题之一。VaR&…...

【Elasticsearch】Elasticsearch 在大数据生态圈的地位 实践经验

Elasticsearch 在大数据生态圈的地位 & 实践经验 1.Elasticsearch 的优势1.1 Elasticsearch 解决的核心问题1.1.1 传统方案的短板1.1.2 Elasticsearch 的解决方案 1.2 与大数据组件的对比优势1.3 关键优势技术支撑1.4 Elasticsearch 的竞品1.4.1 全文搜索领域1.4.2 日志分析…...

Vue3中的computer和watch

computed的写法 在页面中 <div>{{ calcNumber }}</div>script中 写法1 常用 import { computed, ref } from vue; let price ref(100);const priceAdd () > { //函数方法 price 1price.value ; }//计算属性 let calcNumber computed(() > {return ${p…...