海康威视网络摄像头开发流程(三)------------ 添加所需maven依赖并进行配置

1、在pom.xml文件中添加如下所需依赖。

<!--   security     -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!--   thymeleaf     -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!--    mysql    -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <scope>runtime</scope>
</dependency>
<!--    security-test    -->
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-test</artifactId>
    <scope>test</scope>
</dependency>
<!--       mybatis-plus   -->
<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-boot-starter</artifactId>
    <version>3.3.1.tmp</version>
</dependency>
<!--    druid    -->
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>druid</artifactId>
    <version>1.1.18</version>
</dependency>

2、在application.properties文件中添加如下配置。

#Thymeleaf的相关配置
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.servlet.content-type=text/html
spring.thymeleaf.cache=false
spring.thymeleaf.mode=LEGACYHTML5
spring.thymeleaf.encoding=UTF-8


#服务端口号
server.port=8080

#配置数据库

#配置当前要使用的数据源的操作类型
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
#配置MySQL的驱动程序类
spring.datasource.driver-class-name= com.mysql.cj.jdbc.Driver
#数据库连接地址
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/mybatis?useUnicode=true&zeroDateTimeBehavior=convertToNull&autoReconnect=true&characterEncoding=utf-8&serverTimezone=GMT
#数据库用户名
spring.datasource.username=root
#数据库连接密码
spring.datasource.password=123456
#数据库连接池的最小维持连接数
spring.datasource.dbcp2.min-idle= 5
#初始化提供的连接数
spring.datasource.dbcp2.initial-size=5
#最大连接数
spring.datasource.dbcp2.max-total=5
#等待连接获取的最大超时时间
spring.datasource.dbcp2.max-wait-millis=200

# 配置mybatis相关路径
mybatis.mapper-locations=classpath:/mapper/*.xml
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值