Code Monkey home page Code Monkey logo

springboot-seckill's Introduction

基于SpringBoot实现Java高并发之秒杀系统

技术栈

  • 后端: SpringBoot-2.x + Redis-4.x

  • 前端: Bootstrap + Jquery

测试环境

  • IDEA + Maven-10.13 + Tomcat8 + JDK8

启动说明

  • 启动前,请配置好 application.yml 中连接数据库的用户名和密码,以及Redis服务器的地址和端口信息。

  • 启动前,请创建数据库seckill,建表SQL语句放在:/db/sys_schema.sql。具体的建表和建库语句请仔细看SQL文件。

  • 配置完成后,运行位于 src/main/cn/tycoding/下的SpringbootSeckillApplication中的main方法,访问 http://localhost:8080/seckill/ 进行API测试。

  • 注意/db/sys_data.sql中秒杀商品的日期可能要修改,自行修改为符合商品秒杀条件的时间即可。

写在前面

SpringBoot不是对Spring功能上的增强,而是提供了一种快速使用Spring的方式,所以本质上和SSM框架差别不大,所以学习此项目不仅可以学习到秒杀系统的设计流程还能很好的练习一下SpringBoot框架。当然如果你对SpringBoot框架不是很熟悉的话,我推荐你你看一下:

欢迎star(#^.^#)

项目设计

.
├── README  -- Doc文档
├── db  -- 数据库约束文件
├── mvnw  
├── mvnw.cmd
├── pom.xml  -- 项目依赖
└── src
    ├── main
    │   ├── java
    │   │   └── cn
    │   │       └── tycoding
    │   │           ├── SpringbootSeckillApplication.java  -- SpringBoot启动器
    │   │           ├── controller  -- MVC的web层
    │   │           ├── dto  -- 统一封装的一些结果属性,和entity类似
    │   │           ├── entity  -- 实体类
    │   │           ├── enums  -- 手动定义的字典枚举参数
    │   │           ├── exception  -- 统一的异常结果
    │   │           ├── mapper  -- Mybatis-Mapper层映射接口,或称为DAO层
    │   │           ├── redis  -- redis,jedis 相关配置
    │   │           └── service  -- 业务层
    │   └── resources
    │       ├── application.yml  -- SpringBoot核心配置
    │       ├── mapper  -- Mybatis-Mapper层XML映射文件
    │       ├── static  -- 存放页面静态资源,可通过浏览器直接访问
    │       │   ├── css
    │       │   ├── js
    │       │   └── lib
    │       └── templates  -- 存放Thymeleaf模板引擎所需的HTML,不能在浏览器直接访问
    │           ├── page
    │           └── public  -- HTML页面公共组件(头部、尾部)
    └── test  -- 测试文件

Doc

本项目一共分为四个模块来讲解,具体的开发教程请看我的博客文章:


Preview


交流

如果大家有兴趣,欢迎大家加入我的Java交流群:671017003 ,一起交流学习Java技术。博主目前一直在自学JAVA中,技术有限,如果可以,会尽力给大家提供一些帮助,或是一些学习方法,当然群里的大佬都会积极给新手答疑的。所以,别犹豫,快来加入我们吧!


联系

If you have some questions after you see this article, you can contact me or you can find some info by clicking these links.

springboot-seckill's People

Contributors

tycoding avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.