系统分析设计

数据库的设计

商品表
id 商品id 商品name 商品图片 商品类别 商品价格 库存 评价 。。。
订单表
id 订单id 下单时间 商品id集合 用户id 地址 备注 。。。
秒杀表
id 商品id 秒杀开始时间 秒杀结束时间 秒杀价 可秒杀的数量 。。。
用户表(登录功能)

技术方案的设计

springboot + thymeleaf + mybatis + mysql + redis

接口设计

以商品列表所需要的接口为例: 127.0.0.1:8080/goods /show
返回数据: 商品图片 商品名字 商品id 秒杀价 。。。

功能开发前期

搭建springboot框架

使用spring官网提供的模板,快速创建springboot项目
image.png
image.png

  1. spring:
  2. datasource:
  3. url: jdbc:mysql://localhost:3306/seckill
  4. username: root
  5. password: cy414ljh212,,,
  6. driver-class-name: com.mysql.cj.jdbc.Driver
  7. mybatis:
  8. mapper-locations: classpath*:/mappers/*.xml
  9. type-aliases-package: com.duing.model

关联到gitee仓库上

第⼀种:
1)先在gitee上创建仓库 https://gitee.com/klxh-max/springboot-duing-shop-seckill
2)在本地通过idea创建springboot-duing-shop-seckill项目,存放在路径A下
3)git clone 仓库地址,存放在路径B下
4)将路径A中的内容 拷贝到路径B下,然后进行提交和推送(git add)

第⼆种:
1)先在gitee上创建仓库 https://gitee.com/klxh-max/springboot-duing-shop-seckill
2)在本地创建或修改好一个已有的项目,然后对其进行git初始化
git init (让文件夹通过git进行版本管理,会生成 .gitignore文件)
git add (文件夹下的文件需要添加到git中)
之后就分别进行提交、关联、推送
git commit -m “first commit”
git remote add origin https://gitee.com/klxh-max/springboot-duing-shop-seckill
git push -u origin master

基础功能开发

商品列表功能