DUMP2 企业级电商项目
正常设计数据库表,按照数据流向。
~~闭环核心业务
【1用户】登录 =》浏览【2分类】+浏览【3商品】=》加入【4购物车】=》结算【5订单】+【6收货地址】=》【7支付】
【购物车】+【商品】=> 订单子项
【订单子项】+【支付信息】+【收货地址】=> 订单
===========================数据库
表结构
【可分布式唯一索引】【使用 mysql 确定 user_name 唯一性】UNIQUE KEY `user_name_unique` (`username`) USING BTREE
【支持递归的分类】`parent_id` int(11) DEFAULT NULL COMMENT '父类别id当id=0时说明是根节点,一级类别',
【可配置减少数据清洗 只存相对URL】`main_image` varchar(500) DEFAULT NULL COMMENT '产品主图,url相对地址',
【较长文本】`detail` text COMMENT '商品详情' 实际上这里 varchar (容纳65535 / 3 个字符),text 容纳是 65535个字符,空间能小则小。
【精度 总20位包含2位小数】`price` decimal(20,2) NOT NULL COMMENT '价格,单位-元保留两位小数',
【购物车序列化 关联到 session => user_id】`user_id` int(11) NOT NULL
=>【加速查询】KEY `user_id_index` (`user_id`) USING BTREE
【业务相关 实际当时付款】`payment` decimal(20,2) DEFAULT NULL COMMENT '实际付款金额,单位是元,保留两位小数',
【以数字大小清晰的订单状态 状态机】`status` int(10) DEFAULT NULL COMMENT '订单状态:0-已取消-10-未付款,20-已付款,40-已发货,50-交易成功,60-交易关闭',
【利用冗余方便】`total_price` decimal(20,2) DEFAULT NULL COMMENT '商品总价,单位是元,保留两位小数',
【组合索引 根据user_id 和 order_no 去查询】KEY `order_no_user_id_index` (`user_id`,`order_no`) USING BTREE
表关系 数据流向
【不用外键、触发器】1.数据清洗麻烦 2.分布式
【时光机字段】create_time update_time 【查业务问题 trouble shooting】
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
maven arctype webapp
===================================【git 初始化】
【场景是 托管平台上有一个项目,本地有一个项目】【与其相对的是 直接 git clone 下来】
【先去托管平台创建项目】
【本地项目 git 化】
README.md
.gitignore 直接复制一份
【git status】
【1】git init
【2】git add .
【提交到本地仓库】git commit -am "first initial commit "
【添加远程】git remote add origin url
git pull
【推送到远端】git push -u -f origin master
【查看远程分支】git branch -r
【切换到薪的分支 没有则创建】git checkout -b v1.0 origin/master
【将薪的分支 Push到远程】git push origin HEAD -u
===================================【git 初始化】
========================================= maven pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
</compilerArguments>
</configuration>
</plugin>
注意 compilerArguments ,需要做支付宝集成 把 lib 发到服务器上的。
==================================================== Project Stucture
===================================【mybatis 三剑客工具 生成器、分页】
1.确定 数据库连接上服务器了么
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
创建一个 datasource.properties
db.driverLocation=C:/Dev/mysql/mysql-connector-java-5.1.38.jar
db.driverClassName=com.mysql.jdbc.Driver
db.url=jdbc:mysql://192.168.1.112:3306/mmall?characterEncoding=utf-8
db.username=mmall
db.password=123456
第一部 满足了 generatorConfig.xml 后,我们可以使用 maven plugin 执行命令 => dao+pojo+mapper.xml
第二步 修改mapper.xml 把 update_time create_time 交给 mysql 内置函数 now() 处理,越让开发专注业务越好。
分页助手
<!-- mybatis pager --> <dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>4.1.0</version>
</dependency> <dependency>
<groupId>com.github.miemiedev</groupId>
<artifactId>mybatis-paginator</artifactId>
<version>1.2.17</version>
</dependency> <dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>0.9.4</version>
</dependency>
===================================【mybatis 生成器、分页】
===================================【Spring 初始化】
我们可以从官方项目摘取下配置
【宠物医院】https://github.com/spring-projects/spring-petclinic
https://github.com/spring-projects/spring-mvc-showcase
https://github.com/spring-projects/greenhouse
web容器 web.xml
Spring容器 applicationContext.xml
C:\AllWs\idea\mmall\src\main\resources\applicationContext-datasource.xml
C:\AllWs\idea\mmall\src\main\resources\datasource.properties
C:\AllWs\idea\mmall\src\main\resources\mmall.properties
SpringMVC配置 dispatcher-servlet.xml
=> inspection spring core autowiring for bean class 降到warning
locback配置
ftp配置
===================================【Spring 初始化】
====================================【首次提交 】
git add .
git commit -am '首次提交'
git push
git branch - r
git status
====================================【首次提交 】
RESTClient
FE
DUMP2 企业级电商项目的更多相关文章
- Java企业级电商项目架构演进之路 Tomcat集群与Redis分布式
史诗级Java/JavaWeb学习资源免费分享 欢迎关注我的微信公众号:"Java面试通关手册"(坚持原创,分享各种Java学习资源,面试题,优质文章,以及企业级Java实战项目回 ...
- Java从零到企业级电商项目实战
欢迎关注我的微信公众号:"Java面试通关手册"(坚持原创,分享各种Java学习资源,面试题,优质文章,以及企业级Java实战项目回复关键字免费领取)回复关键字:"电商项 ...
- DUMP 5 企业级电商项目
[订单模块] 创建订单 商品信息 订单列表 订单详情 取消订单 订单列表 订单搜素 订单详情 订单发货 [创建订单] 购物车勾选商品 涉及 Cart Product => 一个商品 ...
- DUMP 3.8 企业级电商项目 支付宝之类
① 沙箱登录:https://openhome.alipay.com/platform/appDaily.htm 获得一个 使用环境描述 APPID.授权回调地址.沙箱钱包哪里下载之类的 ② 沙箱环境 ...
- DUMP4 企业级电商项目 —— 对接支付宝扫码支付
延展 <谈谈微信支付曝出的漏洞> [联调 DEMO下载地址]https://docs.open.alipay.com/194/105201/ [内置 一份 说明文档可做参考] [impor ...
- DUMP1 企业级电商项目
系统:centos6 配置mirror阿里云 https://opsx.alibaba.com/mirror 远程管理首选:ssh 账户密码登录(ssh user@host) 或者 本地私钥连接服务器 ...
- 从0到上线开发企业级电商项目_前端_01_sublime使用技巧
一.用户设置 { "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", &quo ...
- DUMP3.5 企业级电商项目
购物车模块 加入商品 更新商品数 查询商品数 移除商品 单选/取消 全选/取消 购物车列表 [浮点型商业运算精度丢失问题]ej1st 一书提到 float double只适合科研计算,BigDeci ...
- DUMP3 企业级电商项目
[开发模式]controller - service(合法校验问题) - dao 反过来也没问题 用户模块 登录 注册 用户名验证(实时反馈前端) 忘记密码 重置密码 退出登录 更新用户信息 获取 ...
随机推荐
- linux ssh免密登陆远程服务器
10.170.1.18服务器免密登录到10.170.1.16服务器 首先登入一台linux服务器(10.170.1.18),此台做为母机(即登入其他linux系统用这台做为入口):执行一行命令生成ke ...
- nuxt axios代理
modules: [ '@nuxtjs/axios', ], axios: { //prefix: '/api/', proxy: true // Can be also an object with ...
- hadoop dfs.datanode.du.reserved 预留空间配置方法
对于datanode配置预留空间的方法 为:在hdfs-site.xml添加如下配置 <property> <name>dfs.datanode.du.reserved< ...
- kubernetes1.14.0部署
2019/4/6/使用kubeadm安装部署kubernetes集群: 前提:1.各节点时间同步:2.各节点主机名称解析:dns OR hosts:3.各节点iptables及firewalld服务被 ...
- tcping ,一个好用的TCP端口检测工具
1.常用的用法(windows) tcp -w 10 -t -d -i 5 -j --color 81.156.165.66 443 2. http模式 -u,与-h命令连用,每一行输出目标的url ...
- odoo12.0 在Ubutu 18.04下环境的搭建
sudo apt-get update sudo apt- postgresql nano virtualenv gcc python3.-dev libxml2-dev libxslt1-dev l ...
- hdu-1728(贪心&&bfs的灵活运用吧)
链接 [https://vjudge.net/contest/256476#problem/D] 题意 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到 ...
- vue脚手架搭建项目引用百度地图--出坑
这是官网地址 https://dafrok.github.io/vue-baidu-map/#/zh/start/installation 需要声明注意的是 BaiduMap 组件容器本身是一个空的块 ...
- Google Closure Compiler高级压缩混淆Javascript代码
一.背景 前端开发中,特别是移动端,Javascript代码压缩已经成为上线必备条件. 如今主流的Js代码压缩工具主要有: 1)Uglify http://lisperator.net/uglifyj ...
- c提高第三次作业
1. char buf[] = "abcdef"; //下面有啥区别? const char *p = buf; //p指向的内存不能变 char const *p = buf; ...