
application.yml配置:
spring:
datasource:
username: root
password: root
url: jdbc:mysql://127.0.0.1:3306/chat?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
driver-class-name: com.mysql.jdbc.Driver
#指定数据源
type: com.alibaba.druid.pool.DruidDataSource
# 数据源其他配置
initialSize: 5
minIdle: 5
maxActive: 20
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,log4j
maxPoolPreparedStatementPerConnectionSize: 20
useGlobalDataSourceStat: true
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
thymeleaf:
suffix: .html
prefix:
classpath: /templates/
cache: false
jackson: #返回的日期字段的格式
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
serialization:
write-dates-as-timestamps: false # true 使用时间戳显示时间
http:
multipart:
max-file-size: 1000Mb
max-request-size: 1000Mb
#配置文件式开发
mybatis:
#全局配置文件的位置
config-location: classpath:mybatis/mybatis-config.xml
#所有sql映射配置文件的位置
mapper-locations: classpath:mybatis/mapper/**/*.xml
server:
session:
timeout: 7200
演示视频:
springboot+websocket聊天系统java聊天室源码




package com.chat.controller;
import co
Spring Boot WebSocket聊天系统实战

本文介绍了一个基于Spring Boot和WebSocket技术实现的聊天系统。该系统包括前后端交互设计、数据库配置、用户验证及消息传递等功能。通过具体的代码示例展示了如何搭建一个实时聊天平台。
最低0.47元/天 解锁文章
1057

被折叠的 条评论
为什么被折叠?



