代码拉取完成,页面将自动刷新
环境要求: Maven
、Mysql
、jdk1.8
及以上、tomcat9
及以上
如果没有安装这些,可以阅读我的这几篇文章进行安装
找到utils目录下的.sql文件,附加到你的数据库中
作者我的数据库版本是(5.7),有需要自己修改以下两个
运行效果
后端:Servlet、JavaBean、JDBC、JWT
前端:vue.js、axios、element-ui、echarts、
前端项目地址:sports_shop_front
http://localhost:8888/sports_shop_backend_war/
http://localhost:8888/sports_shop_backend_war/users_picture/
http://localhost:8888/sports_shop_backend_war/goods_picture/
Authorization
字段提供 token
令牌状态码 | 含义 | 说明 |
---|---|---|
200 | OK | 请求成功 |
201 | CREATED \ INTSERT | 创建成功 \ 新增添加成功 |
204 | DELETED | 删除成功 |
400 | BAD REQUEST | 请求的地址不存在或者包含不支持的参数 |
401 | UNAUTHORIZED | 未授权 |
403 | FORBIDDEN | 被禁止访问 |
404 | NOT FOUND | 请求的资源不存在 |
422 | Unprocesable entity | [POST/PUT/PATCH] 当创建一个对象时,发生一个验证错误 |
500 | INTERNAL SERVER ERROR | 内部错误 |
关于数据表与前端界面的详细信息,请移步看我的前端项目文档 sports_shop_front
数据库中共有五张表:
前端共有七个界面:
功能需求汇总
统计系统所需操作,思考后端接口编写
待后续添加的功能:
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
username | query | string | 否 | none |
password | query | string | 否 | none |
返回示例
成功
{
"data": {
"grade": "vip",
"level": 1,
"password": "123456",
"state_message": "这个人很懒,什么都没有留下",
"token": "eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIxIiwic3ViIjoiYWRtaW4iLCJpc3MiOiJpY2VmaXNoIiwiaWF0IjoxNjcwMjA3MjMyLCJleHAiOjE2NzAyOTM2MzIsImFjcm9zcyI6InRydWUiLCJ1c2VyX2lkIjoxLCJ1c2VybmFtZSI6ImFkbWluIn0.4WpF1CGGmuekH1c1q1h8bWGEo0FCizAOeiXfx1bfqH0",
"type": "root",
"user_id": 1,
"user_picture": "http://127.0.0.1:8888/users_picture/xxx.jpg",
"username": "admin",
"wallet": 9999
},
"meta": {
"msg": "登录成功",
"status": 200
}
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
username | query | string | 否 | none |
password | query | string | 否 | none |
user_picture | query | string | 否 | none |
type | query | string | 否 | none |
返回示例
成功
{
"data": {
"grade": "vip",
"level": 1,
"password": "123456",
"state_message": "这个人很懒,什么都没有留下",
"type": "root",
"user_id": 16,
"user_picture": "http://192.168.123.53:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"username": "kzb",
"wallet": 1000
},
"meta": {
"msg": "添加用户成功",
"status": 201
}
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
user_id | query | string | 否 | none |
返回示例
成功
{
"data": {
"grade": "vip",
"level": 1,
"password": "123456",
"state_message": "这个人很懒,什么都没有留下",
"type": "root",
"user_id": 4,
"user_picture": "http://192.168.123.53:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"username": "冰镇生鲜",
"wallet": -10189
},
"meta": {
"msg": "获取用户信息成功",
"status": 200
}
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
says_time | query | string | 否 | none |
says | query | string | 否 | none |
goods_id | query | string | 否 | none |
user_id | query | string | 否 | none |
username | query | string | 否 | none |
order_id | query | string | 否 | none |
返回示例
成功
{
"data": "薇我50,肯德基疯狂星期四",
"meta": {
"msg": "添加评论成功",
"status": 200
}
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
返回示例
成功
{
"data": [
{
"goods_describe": "为发烧而生",
"goods_id": 1,
"goods_name": "红米note",
"goods_picture": "http://localhost:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 799
},
{
"goods_describe": "为发烧而生",
"goods_id": 2,
"goods_name": "小米12S Pro",
"goods_picture": "http://localhost:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 4399
},
{
"goods_describe": "为发烧而生",
"goods_id": 3,
"goods_name": "小米12S",
"goods_picture": "http://localhost:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 3699
},
{
"goods_describe": "为发烧而生",
"goods_id": 4,
"goods_name": "小米12X",
"goods_picture": "http://localhost:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 2699
},
{
"goods_describe": "为发烧而生",
"goods_id": 5,
"goods_name": "小米11 青春版",
"goods_picture": "http://localhost:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 1799
},
{
"goods_describe": "为发烧而生",
"goods_id": 6,
"goods_name": "小米Civi2",
"goods_picture": "http://localhost:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 2399
}
],
"meta": {
"msg": "获取商品信息成功",
"status": 200
}
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
goods_id | query | string | 否 | none |
返回示例
成功
{
"data": {
"comment": [
{
"order_id": 3,
"says": "薇我50,肯德基疯狂星期四",
"says_id": 1,
"says_time": 1670083200000,
"user_id": 2,
"username": "冰镇生鲜"
},
{
"order_id": 3,
"says": "薇我30,肯德基疯狂星期四",
"says_id": 2,
"says_time": 1670083200000,
"user_id": 2,
"username": "冰镇生鲜"
},
{
"order_id": 3,
"says": "薇我20,肯德基疯狂星期四",
"says_id": 3,
"says_time": 1670169600000,
"user_id": 2,
"username": "冰镇生鲜"
},
{
"order_id": 3,
"says": "薇我10,肯德基疯狂星期四",
"says_id": 4,
"says_time": 1670688000000,
"user_id": 2,
"username": "冰镇生鲜"
},
{
"order_id": 62,
"says": "今天天气真不错",
"says_id": 8,
"says_time": 1670947200000,
"user_id": 4,
"username": "冰镇生鲜"
},
{
"order_id": 63,
"says": "吃了没",
"says_id": 9,
"says_time": 1670947200000,
"user_id": 4,
"username": "冰镇生鲜"
}
],
"goods_describe": "为发烧而生",
"goods_id": 1,
"goods_name": "红米note",
"goods_picture": "http://localhost:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 799
},
"meta": {
"msg": "获取商品信息成功",
"status": 200
}
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
shopping_count | query | string | 否 | none |
shopping_amount | query | string | 否 | none |
goods_id | query | string | 否 | none |
goods_name | query | string | 否 | none |
goods_price | query | string | 否 | none |
goods_picture | query | string | 否 | none |
goods_describe | query | string | 否 | none |
user_id | query | string | 否 | none |
username | query | string | 否 | none |
返回示例
成功
{
"data": {
"goods_id": 1,
"shopping_cart_id": 64,
"user_id": 4
},
"meta": {
"msg": "添加购物车成功",
"status": 200
}
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
order_time | query | string | 否 | none |
order_count | query | string | 否 | none |
order_amount | query | string | 否 | none |
user_id | query | string | 否 | none |
username | query | string | 否 | none |
goods_id | query | string | 否 | none |
goods_name | query | string | 否 | none |
goods_price | query | string | 否 | none |
goods_picture | query | string | 否 | none |
goods_describe | query | string | 否 | none |
total_pay | query | string | 否 | none |
返回示例
成功
{
"data": {
"thanks": "没有别的意思,谢谢老板"
},
"meta": {
"msg": "结算商品成功",
"status": 201
}
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
user_id | query | string | 否 | none |
返回示例
成功
{
"data": [
{
"goods_describe": "为发烧而生",
"goods_id": 4,
"goods_name": "小米12X",
"goods_picture": "http://localhost:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 2699,
"order_amount": 2699,
"order_count": 1,
"order_id": 60,
"order_time": 1670947200000,
"says": "买家未做出评价",
"user_id": 1,
"username": "admin"
},
{
"goods_describe": "为发烧而生",
"goods_id": 5,
"goods_name": "小米11 青春版",
"goods_picture": "http://localhost:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 1799,
"order_amount": 1799,
"order_count": 1,
"order_id": 61,
"order_time": 1670947200000,
"says": "买家未做出评价",
"user_id": 1,
"username": "admin"
}
],
"meta": {
"msg": "获取商品信息成功",
"status": 200
}
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
user_id | query | string | 否 | none |
返回示例
成功
{
"data": [
{
"goods_describe": "为发烧而生",
"goods_id": 1,
"goods_name": "红米note",
"goods_picture": "http://192.168.123.53:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 1999,
"shopping_amount": 799,
"shopping_cart_id": 4,
"shopping_count": 1,
"user_id": 4,
"username": "冰镇生鲜"
},
{
"goods_describe": "为发烧而生",
"goods_id": 1,
"goods_name": "红米note",
"goods_picture": "http://192.168.123.53:8888/sports_shop_backend_war/users_picture/kzb68up.jpg",
"goods_price": 1999,
"shopping_amount": 1999,
"shopping_cart_id": 64,
"shopping_count": 1,
"user_id": 4,
"username": "冰镇生鲜"
}
],
"meta": {
"msg": "获取用户相关购物车成功",
"status": 200
}
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
shopping_count | query | string | 否 | none |
shopping_amount | query | string | 否 | none |
goods_id | query | string | 否 | none |
goods_name | query | string | 否 | none |
goods_price | query | string | 否 | none |
goods_picture | query | string | 否 | none |
goods_describe | query | string | 否 | none |
user_id | query | string | 否 | none |
username | query | string | 否 | none |
shopping_cart_id | query | string | 否 | none |
返回示例
成功
{
"msg": "购买成功。1、添加订单记录2、删除购物车记录3、扣除用户金额",
"status": 200
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
order_id | query | string | 否 | none |
says | query | string | 否 | none |
goods_id | query | string | 否 | none |
user_id | query | string | 否 | none |
username | query | string | 否 | none |
返回示例
成功
{
"msg": "修改order表says成功,修改comment表says成功",
"status": 200
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
order_id | query | string | 否 | none |
返回示例
成功
{
"msg": "(60)删除订单记录成功",
"status": 200
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
shopping_cart_id | query | string | 否 | none |
返回示例
成功
{
"msg": "(60)删除订单记录成功",
"status": 200
}
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | OK | 成功 | Inline |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。