Skip to content

Commit 0db411d

Browse files
author
sqmax
committed
modify readme.md
1 parent b8e0b29 commit 0db411d

File tree

4 files changed

+85
-61
lines changed

4 files changed

+85
-61
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,16 @@
33
* 项目整体介绍。[http://www.sqmax.top/springboot-project/](http://www.sqmax.top/springboot-project/)
44
* 项目中设计的知识细节及难点以博客的形式整理在Wiki里。[Wiki](https://github.com/sqmax/springboot-project/wiki)
55

6+
## 使用方式
67

8+
1. 使用命令`git clone https://github.com/sqmax/springboot-project.git`克隆到本地。
9+
2. 在IDEA里。File->open...,然后选择项目文件夹。
10+
3. 在IDEA里,安装lombok插件。File->Settings...->Plugin,搜索lombok,安装。
11+
4. 运行数据库脚本sqmax.sql(注意这里使用的是MySQL5.7,不同的数据库版本可能语法可能有些差异)。
12+
5. 以SellApplication类为Main class来运行项目(Spring Boot就是这样可以像运行一个main方法的类来启动一个Web项目)。
13+
6. 浏览器访问:`http://localhost:8080/sell/seller/order/list`,就可以来到商家管理界面。
14+
7. 对于手机端微信公众号内访问,设计到挺复杂的微信调试。这里就不再介绍。可以使用postman这个工具模拟微信点餐下单。访问接口参见controller包下以Buyer开头的类。
15+
8. 如果相查看微信端的访问效果,可以在微信客户端访问这个链接:`http://sell.springboot.cn/`。(注意这是师兄上线的项目演示)
16+
17+
18+
>关于IDEA,对于使用Eclipse,可以尝试一下IDEA,非常智能好用,可以参见一下这个仓库:[https://github.com/judasn/IntelliJ-IDEA-Tutorial](https://github.com/judasn/IntelliJ-IDEA-Tutorial),非常好的IDEA使用教程。

sqmax.sql

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
drop database if exists sell;
2+
create database sell;
3+
use sell;
4+
5+
-- 类目
6+
create table `product_category` (
7+
`category_id` int not null auto_increment,
8+
`category_name` varchar(64) not null comment '类目名字',
9+
`category_type` int not null comment '类目编号',
10+
`create_time` timestamp not null default current_timestamp comment '创建时间',
11+
`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
12+
primary key (`category_id`)
13+
);
14+
15+
-- 商品
16+
create table `product_info` (
17+
`product_id` varchar(32) not null,
18+
`product_name` varchar(64) not null comment '商品名称',
19+
`product_price` decimal(8,2) not null comment '单价',
20+
`product_stock` int not null comment '库存',
21+
`product_description` varchar(64) comment '描述',
22+
`product_icon` varchar(512) comment '小图',
23+
`product_status` tinyint(3) DEFAULT '0' COMMENT '商品状态,0正常1下架',
24+
`category_type` int not null comment '类目编号',
25+
`create_time` timestamp not null default current_timestamp comment '创建时间',
26+
`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
27+
primary key (`product_id`)
28+
);
29+
30+
-- 订单
31+
create table `order_master` (
32+
`order_id` varchar(32) not null,
33+
`buyer_name` varchar(32) not null comment '买家名字',
34+
`buyer_phone` varchar(32) not null comment '买家电话',
35+
`buyer_address` varchar(128) not null comment '买家地址',
36+
`buyer_openid` varchar(64) not null comment '买家微信openid',
37+
`order_amount` decimal(8,2) not null comment '订单总金额',
38+
`order_status` tinyint(3) not null default '0' comment '订单状态, 默认为新下单',
39+
`pay_status` tinyint(3) not null default '0' comment '支付状态, 默认未支付',
40+
`create_time` timestamp not null default current_timestamp comment '创建时间',
41+
`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
42+
primary key (`order_id`),
43+
key `idx_buyer_openid` (`buyer_openid`)
44+
);
45+
46+
-- 订单商品
47+
create table `order_detail` (
48+
`detail_id` varchar(32) not null,
49+
`order_id` varchar(32) not null,
50+
`product_id` varchar(32) not null,
51+
`product_name` varchar(64) not null comment '商品名称',
52+
`product_price` decimal(8,2) not null comment '当前价格,单位分',
53+
`product_quantity` int not null comment '数量',
54+
`product_icon` varchar(512) comment '小图',
55+
`create_time` timestamp not null default current_timestamp comment '创建时间',
56+
`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
57+
primary key (`detail_id`),
58+
key `idx_order_id` (`order_id`)
59+
);
60+
61+
-- 卖家(登录后台使用, 卖家登录之后可能直接采用微信扫码登录,不使用账号密码)
62+
create table `seller_info` (
63+
`id` varchar(32) not null,
64+
`username` varchar(32) not null,
65+
`password` varchar(32) not null,
66+
`openid` varchar(64) not null comment '微信openid',
67+
`create_time` timestamp not null default current_timestamp comment '创建时间',
68+
`update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',
69+
primary key (`id`)
70+
) comment '卖家信息表';
71+
72+

src/main/resources/application.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ spring:
33
driver-class-name: com.mysql.jdbc.Driver
44
username: root
55
password: 123456
6-
url: jdbc:mysql://192.168.0.104/sell?characterEncoding=utf-8&useSSL=false
6+
url: jdbc:mysql://127.0.0.1/sell?characterEncoding=utf-8&useSSL=false
77
jpa:
88
show-sql: true
99
jackson:

src/main/resources/sqmax.sql

-60
This file was deleted.

0 commit comments

Comments
 (0)