SpringBoot构建电商基础秒杀项目vue
视频地址 https://www.imooc.com/video/18332java
maven-archetype-quickstartgit
不用springboot能够说使用maven-archetype-webapp,生成项目能够打包成war发布到容器github
vuejs版本 https://gitee.com/349032805/miaosha-allweb
https://gitee.com/robei/miaosha https://github.com/hongjun500/miaoshaspring
spring官方rest例子 https://spring.io/guides/gs/rest-service/数据库
resources目录下application.properties
server.port=8080springboot
dependency:
数据库驱动 数据库链接池 如druidmybatis
com.alibaba
druidapp
org.mybatis.spring.boot
mybatis-spring-boot-starter
配置文件
mybatis.mapperLocations=classpath:mapping/*.xml spring.datasource.name= spring.dataourse.url= spring.datasource.username= spring.datasource.password=
spring.datasource.type=com.alibaba.druid.poll.DruidDataSource spring.datasource.driverClassName=
mapping建立在resources目录下
@MapperScan("com.xxxx.xxx")
mybatis-generator.xml
register_mode 注册方式 thrid_party_id 第三方id 密码跟用户主表分开存取
service下model目录
controller下建立viewobject目录
BeanUtils.copyProperties(source, targert)
通用返回对象 error目录 enum EmBusinessError implements CommonError // 通用错误类型00001 PARAMETER_VALIDATION_ERROR(00001, "参数不合法") USER_NOT_EXIST(10001, “用户不存在”); int errCode String errMsg
joda-time jar包
class PromoModel Integer id // 1 未开始 2 进行中 3 已结束 Integer status // 秒杀活动名 String promoName DateTime startDate DateTime endDate Integer itemId // 秒杀活动商品价格 BigDecimal promoItemPrice