摘要: MVC(Model–view–controller)是软件工程中的一种软件架构模式,基于此模式把软件系统分为三个基本部分:模型(Model)、视图(View)和控制器(Controller)。目的是通过这样的设计使程序结构更加简洁、直观,降低问题的复杂度。其中各个组成部分的职责为: 视图(View) 阅读全文
posted @ 2020-10-07 20:21 Zr0118 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 第一步:添加mybatis启动依赖 1 <dependency> 2 <groupId>org.mybatis.spring.boot</groupId> 3 <artifactId>mybatis-spring-boot-starter</artifactId> 4 <version>2.1.1< 阅读全文
posted @ 2020-10-07 19:16 Zr0118 阅读(208) 评论(0) 推荐(0) 编辑
摘要: HiKariCP号称是目前世界上最快的连接池,有江湖一哥的称号,目前在 springboot工程默认推荐使用HiKariCP连接池,现在我们创建一个新的项目,项目名为CGB-SBOOT-02,在此工程中整合HiKariCP,其步骤如下: 第一步:查找mysql 驱动依赖,JDBC API依赖 依赖添 阅读全文
posted @ 2020-10-07 18:48 Zr0118 阅读(718) 评论(0) 推荐(0) 编辑
摘要: 1.@Autowired自动注入,默认是先以byType的方式,如果有多个类型相匹配,那么使用byName进行注入2.如果想直接使用byName的注入方式,那么需要在@Autowired注解的下面加上注解@Qualifier(“userService”),括号里面为要注入的bean的name,如图 阅读全文
posted @ 2020-10-07 18:34 Zr0118 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1 package com.cy.pj.common.cache; 2 @Component 3 @Scope("singleton") 4 @Lazy 5 public class DefaultCache { 6 public DefaultCache() { 7 System.out.prin 阅读全文
posted @ 2020-10-07 17:20 Zr0118 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 打开maven中的setting.xml文件,并对其如下选项进行配置。 1.配置maven本地库(从maven远程服务器下载的资源存储到的位置) 1 <localRepository>${user.home}/.m3/repository</localRepository> 2.配置maven私服( 阅读全文
posted @ 2020-10-07 16:20 Zr0118 阅读(63) 评论(0) 推荐(0) 编辑