SpringBoot构建电商基础秒杀项目 学习笔记 新建表 create table if not exists promo ( id int not null auto_increment, promo_name varchar(64) not null default '', start_date datetime not null default '0000-00-00 00:00:00', end_date datetime not null default '0000-00-00 00
SpringBoot构建电商基础秒杀项目 学习笔记 新建表 create table if not exists order_info ( id varchar(32) not null default '', user_id int not null default 0, item_id int not null default 0, item_price double(10, 2) not null default 0, amount int not null default 0, orde
SpringBoot构建电商基础秒杀项目 学习笔记 新建数据表 create table if not exists item ( id int not null auto_increment, title varchar(64) not null default '', price double(10, 0) not null default 0, description varchar(500) null default '', sales int not null default 0, i
SpringBoot构建电商基础秒杀项目 学习笔记 定义通用的返回对象 public class CommonReturnType { // success, fail private String status; // status = success, data 内返回前端需要的 json数据 // status = fail, data 内使用通用的错误码格式 private Object data; public static CommonReturnType create(Object
SpringBoot构建电商基础秒杀项目 学习笔记 Spring Boot 其实不是什么新的框架,它默认配置了很多框架的使用方式,就像 maven 整合了所有的 jar 包, Spring Boot 整合了所有的框架,并通过一行简单的 main 方法启动应用 使用 IDEA 新建 maven-archetype-quickstart 项目 添加 Spring Boot 依赖 <parent> <groupId>org.springframework.boot</groupId