电商秒杀系统方案优化,高性能高并发实战(一):项目框架搭建
一:简介:
后端技术采用SpringBoot,JSR303和Mybatis来实现。
秒杀系统包括:分布式会话,商品列表页,商品详情页,订单详情页,系统压测,缓存优化,消息队列,接口安全。
学习这门课程可以学到 如何利用缓存,如何使用异步,如何编写优雅的代码。
二、项目搭建:
继承Thymeleaf,Result结果封装,mybatis+Druid集成;jedis集成+redis集成+通用缓存Key封装
三:代码实现
application.porperties配置文件
1.springboot.thymeleaf配置
#thymeleaf
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.cache=false
spring.thymeleaf.content-type=text/html
spring.thymeleaf.enabled=true
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.mode=HTML5
2.mybatis druid redis配置
#mybatis