misssimple 后台管理模块接口文档
1.5 用户管理
1.5.1 用户分页&条件查询
- 请求路径:http://localhost:8888/mss-web/user/findAllUserByPage
- 请求方法:post
- 请求参数
参数名称 |
参数说明 |
in |
是否必须 |
数据类型 |
备注 |
pagenum |
当前页 |
|
false |
integer(int32) |
|
pagesize |
每页显示条数 |
|
false |
integer(int32) |
|
username |
用户名 |
|
false |
String |
输入手机号即可 |
startCreateTime |
注册起始时间 |
|
false |
Date |
|
endCreateTime |
注册结束时间 |
|
false |
Date |
|
{
"currentPage": "1",
"pageSize": "10",
"startCreateTime": "2020-07-09",
"endCreateTime": "2021-12-12",
"username": "138"
}
{
"data": [
{
"id": 100030025,
"name": "admin",
"portrait": null,
"phone": "13851113817",
"password": null,
"regIp": null,
"accountNonLocked": 1,
"status": 1,
"isDel": 0,
"createTime": 1614412636000,
"updateTime": 1614418195000
}
],
"meta": {
"status": 200,
"msg": "成功查询用户"
}
}
1.5.2 用户状态设置
- 请求路径:http://localhost:8888/mss-web/user/updateUserStatus
- 请求方法:get
- 请求参数
参数名称 |
参数说明 |
in |
是否必须 |
数据类型 |
备注 |
id |
用户id |
|
是 |
integer(int32) |
|
status |
用户状态 |
|
是 |
integer(tinyint1) |
用户状态:1能登录,0不能登录 |
{
"data": {
"status": 0
},
"meta": {
"status": 202,
"msg": "更新用户状态成功"
}
}
1.5.3 添加用户
- 请求路径:http://localhost:8888/mss-web/user/saveUser
- 请求方法:post
- 请求参数
{
"name": "admin",
"portrait": null,
"phone": "13851111111",
"password": "111111"
}
{
"data": null,
"meta": {
"status": 201,
"msg": "成功添加用户"
}
}
1.5.4 更新用户
- 请求路径:http://localhost:8888/mss-web/user/updateUser
- 请求方法:post
- 请求参数
{
"id":100030028,
"name": "admin",
"portrait": null,
"phone": "13851111116",
"password": "222222"
}
{
"data": null,
"meta": {
"status": 202,
"msg": "更新用户成功"
}
}
1.5.5 删除用户
- 请求路径:http://localhost:8888/mss-web/user/deleteUser
- 请求方法:get
- 请求参数
参数名称 |
参数说明 |
in |
是否必须 |
数据类型 |
备注 |
id |
用户id |
|
是 |
integer(int32) |
|
{
"data": null,
"meta": {
"status": 203,
"msg": "删除用户成功"
}
}
1.5.6 用户登录
- 请求路径:http://localhost:8888/mss-web/user/login
- 请求方法:post
- 请求参数
{
"username":"admin1",
"password": "222222"
}
{
"data": {
"id": 100030028,
"name": "admin1",
"portrait": null,
"phone": "13851111116",
"password": "55a3a9105b6f6ec143a2c8dbcef8deb5",
"regIp": null,
"accountNonLocked": 1,
"status": 1,
"isDel": 0,
"createTime": 1614419343000,
"updateTime": 1614421393000
},
"meta": {
"status": 200,
"msg": "登录成功"
}
}
{
"data": null,
"meta": {
"status": 500,
"msg": "用户名或密码错误"
}
}
1.6. 商品分类管理
1.6.1. 商品分类数据列表
- 请求路径:http://localhost:8888/mss-web/category/findCategory
- 请求方法:get
- 请求参数
参数名 |
类型 |
参数说明 |
备注 |
type |
int |
[1,2] |
值:1,2分别表示显示一层二层分类列表 【可选参数】如果不传递,则默认获取所有级别的分类 |
pagenum |
int |
当前页码值 |
【可选参数】如果不传递,则默认获取所有分类 (0) |
pagesize |
int |
每页显示多少条数据 |
【可选参数】如果不传递,则默认获取所有分类 (0) |
参数名 |
参数说明 |
备注 |
catId |
分类 ID |
|
catName |
分类名称 |
|
catPid |
分类父 ID |
|
catLevel |
分类当前层级 |
|
catIcon |
? |
|
catSrc |
? |
|
isDel |
是否删除 |
|
"data": [
{
"catId": 1000,
"catName": "衣服",
"catPid": 0,
"catLevel": 1,
"catIcon": null,
"catSrc": null,
"isDel": 0,
"createTime": 1635736271000,
"updateTime": 1635736271000,
"deleteTime": null,
"createdBy": "system",
"updatedBy": "system",
"deletedBy": null,
"children": [
{
"catId": 1001,
"catName": "上衣",
"catPid": 1000,
"catLevel": 2,
"catIcon": null,
"catSrc": null,
"isDel": 0,
"createTime": 1635736271000,
"updateTime": 1635736271000,
"deleteTime": null,
"createdBy": "system",
"updatedBy": "system",
"deletedBy": null,
"children": null
}
]
}
],
"meta": {
"status": 200,
"msg": "成功获取商品分类"
}
}
{
"data": {
"pageNum": 1,
"pageSize": 5,
"size": 1,
"orderBy": null,
"startRow": 1,
"endRow": 1,
"total": 1,
"pages": 1,
"list": [
{
"catId": 1000,
"catName": "衣服",
"catPid": 0,
"catLevel": 1,
"catIcon": null,
"catSrc": null,
"isDel": 0,
"createTime": 1635736271000,
"updateTime": 1635736271000,
"deleteTime": null,
"createdBy": "system",
"updatedBy": "system",
"deletedBy": null,
"children": [
{
"catId": 1001,
"catName": "上衣",
"catPid": 1000,
"catLevel": 2,
"catIcon": null,
"catSrc": null,
"isDel": 0,
"createTime": 1635736271000,
"updateTime": 1635736271000,
"deleteTime": null,
"createdBy": "system",
"updatedBy": "system",
"deletedBy": null,
"children": null
}
]
}
],
"firstPage": 1,
"prePage": 0,
"nextPage": 0,
"lastPage": 1,
"isFirstPage": true,
"isLastPage": true,
"hasPreviousPage": false,
"hasNextPage": false,
"navigatePages": 8,
"navigatepageNums": [
1
]
},
"meta": {
"status": 200,
"msg": "成功获取商品分类"
}
}
1.6.2. 添加分类
- 请求路径:http://localhost:8888/mss-web/category/saveCategory
- 请求方法:post
- 请求参数
参数名 |
参数说明 |
备注 |
catName |
分类名称 |
不能为空 |
catPid |
分类父 ID |
不能为空,如果要添加1级分类,则父分类Id应该设置为 0 |
catLevel |
分类层级 |
不能为空,0 表示一级分类;1 表示二级分类; |
catIcon |
? |
|
catSrc |
? |
|
{
"catName": "鞋",
"catPid": 0,
"catLevel": 1,
"catIcon": null,
"catSrc": null
}
{
"data": null,
"meta": {
"msg": "成功添加商品分类",
"status": 201
}
}
1.6.3. 根据 id 查询分类
- 请求路径:http://localhost:8888/mss-web/category/findCategoryByCatId
- 请求方法:get
- 请求参数
参数名 |
参数说明 |
备注 |
catId |
分类 ID |
不能为空 |
{
"data": {
"catId": 1000,
"catName": "衣服",
"catPid": 0,
"catLevel": 1,
"catIcon": null,
"catSrc": null,
"isDel": 0,
"createTime": 1635736271000,
"updateTime": 1635736271000,
"deleteTime": null,
"createdBy": "system",
"updatedBy": "system",
"deletedBy": null,
"children": null
},
"meta": {
"status": 200,
"msg": "成功查询商品分类"
}
}
1.6.4. 编辑提交分类
- 请求路径:http://localhost:8888/mss-web/category/updateCategory
- 请求方法:post
- 请求参数
参数名 |
参数说明 |
备注 |
id |
分类 ID |
不能为空 |
cat_name |
分类名称 |
不能为空 |
{
"catId": 1000,
"catName": "衣服1"
}
{
"data": null,
"meta": {
"msg": "成功编辑商品分类",
"status": 202
}
}
1.6.5. 删除分类
- 请求路径:http://localhost:8888/mss-web/category/deleteCateGory
- 请求方法:get
- 请求参数
参数名 |
参数说明 |
备注 |
catId |
分类 ID |
不能为空 |
{
"data": null,
"meta": {
"status": 203,
"msg": "成功删除商品分类"
}
}
1.8. 商品管理
1.8.1. 商品列表数据
- 请求路径:http://localhost:8888/mss-web/goods/findAllGoods
- 请求方法:post
- 请求参数
参数名 |
参数说明 |
备注 |
goodsName |
商品名称 |
可以为空 |
status |
是否上架 |
空:全部/1:上架/0:下架 |
catId |
商品分类 |
可以为空 |
pagenum |
当前页码 |
不能为空 |
pagesize |
每页显示条数 |
不能为空 |
{
"goodsName": "风衣",
"status": 0,
"catId": 1001,
"pagenum": 1,
"pagesize": 5
}
{
"data": {
"pageNum": 1,
"pageSize": 5,
"size": 1,
"orderBy": null,
"startRow": 1,
"endRow": 1,
"total": 1,
"pages": 1,
"list": [
{
"goodsId": 5000,
"goodsName": "FRAME 正品原单风衣",
"goodsPrice": 698.0,
"goodsNumber": 10,
"goodsWeight": 0,
"catId": 1001,
"goodsIntroduce": "纯棉材质",
"goodsBigLogo": "https://img.imgdb.cn/item/600129a03ffa7d37b32d30d9.png",
"goodsSmallLogo": "https://img.imgdb.cn/item/600129a03ffa7d37b32d30d9.png",
"catOneId": 1000,
"caTwoId": null,
"hotNumber": 0,
"isPromote": 0,
"status": 0,
"isDel": 0,
"createTime": 1635736271000,
"updateTime": 1635736271000,
"deleteTime": null,
"createdBy": "system",
"updatedBy": "system",
"deletedBy": null
}
],
"firstPage": 1,
"prePage": 0,
"nextPage": 0,
"lastPage": 1,
"isFirstPage": true,
"isLastPage": true,
"hasPreviousPage": false,
"hasNextPage": false,
"navigatePages": 8,
"navigatepageNums": [
1
]
},
"meta": {
"status": 200,
"msg": "成功查询商品"
}
}
1.8.2. 添加商品
- 请求路径:http://localhost:8888/mss-web/goods/saveGoods
- 请求方法:post
- 请求参数
参数名 |
参数说明 |
备注 |
goodsName |
商品名称 |
不能为空 |
goodsPrice |
价格 |
不能为空 |
catIds |
以为’,'分割的分类列表 |
不能为空 |
goodsIntroduce |
介绍 |
可以为空 |
pics |
上传的图片临时路径(对象) |
可以为空 |
{
"goodsName":"打底针织衫",
"goodsPrice": "198",
"catId":"1000,1001",
"goodsIntroduce":"平时穿S-M码的美女OK",
"pics":[
{
"pic":"https://p.pstatp.com/origin/137da000382450120da53"}
]
}
{
"data": null,
"meta": {
"status": 201,
"msg": "成功添加商品"
}
}
1.8.3. 根据 ID 查询商品
- 请求路径:http://localhost:8888/mss-web/goods/findGoodsById
- 请求方法:get
- 请求参数
参数名 |
参数说明 |
备注 |
goodsId |
商品 ID |
不能为空 |
{
"data": {
"goodsId": 5000,
"goodsName": "FRAME 正品原单风衣",
"goodsPrice": 698.0,
"catId": 1001,
"goodsIntroduce": "纯棉材质",
"goodsBigLogo": null,
"goodsSmallLogo": "https://img.imgdb.cn/item/600129a03ffa7d37b32d30d9.png",
"catOneId": 1000,
"caTwoId": null,
"hotNumber": 0,
"isPromote": 0,
"status": 0,
"isDel": 0,
"createTime": 1635736271000,
"updateTime": 1635736271000,
"deleteTime": null,
"createdBy": "system",
"updatedBy": "system",
"deletedBy": null,
"pics": [
{
"picsId": 4000,
"goodsId": 5000,
"picsBig": "https://p.pstatp.com/origin/137da000382450120da53",
"picsMid": null,
"picsSma": null,
"isDel": 0,
"createTime": 1635736271000,
"updateTime": 1635736271000,
"deleteTime": null,
"createdBy": "system",
"updatedBy": "system",
"deletedBy": null
}
]
},
"meta": {
"status": 200,
"msg": "成功查询商品"
}
}
1.8.4. 编辑提交商品
- 请求路径:http://localhost:8888/mss-web/goods/updateGoods
- 请求方法:post
- 请求参数
参数名 |
参数说明 |
备注 |
goodsId |
商品id |
不能为空 |
goodsName |
商品名称 |
不能为空 |
goodsPrice |
价格 |
不能为空 |
catIds |
以为’,'分割的分类列表 |
不能为空 |
goodsIntroduce |
介绍 |
可以为空 |
pics |
上传的图片临时路径(对象) |
可以为空 |
{
"goodsId":5006,
"goodsName":"打底针织衫sss",
"goodsPrice": "198",
"catIds":[1003,1004],
"goodsIntroduce":"平时穿S-M码的美女OK ssss",
"pics":[
{
"pic":"https://img.imgdb.cn/item/6039055f5f4313ce2557c5b5.jpg"},
{
"pic":"https://img.imgdb.cn/item/6039cdf25f4313ce25d25576.jpg"}
]
}
参数名 |
参数说明 |
备注 |
total |
总共商品条数 |
|
pagenum |
当前商品页数 |
|
goods_id |
商品 ID |
|
goods_name |
商品名称 |
|
goods_price |
价格 |
|
goods_number |
数量 |
|
goods_weight |
重量 |
不能为空 |
goods_state |
商品状态 |
商品状态 0: 未通过 1: 审核中 2: 已审核 |
add_time |
添加时间 |
|
upd_time |
更新时间 |
|
hot_mumber |
热销品数量 |
|
is_promote |
是否是热销品 |
|
pics |
上传的图片临时路径(对象) |
pics_id:图片 ID,goods_id:商品 ID,pics_big:大图,pics_mid:中图,pics_sma:小图 |
attrs |
商品的参数(数组) |
goods_id:商品 ID,attr_value:当前商品的参数值,add_price:浮动价格,attr_vals:预定义的参数值,attr_sel:手动输入,还是单选, |
{
"data": null,
"meta": {
"status": 202,
"msg": "成功更新商品信息"
}
}
1.8.5. 删除商品
- 请求路径:http://localhost:8888/mss-web/goods/deleteGoods
- 请求方法:get
- 请求参数
参数名 |
参数说明 |
备注 |
goodsId |
商品 ID |
不能为空 |
{
"data": null,
"meta": {
"msg": "删除成功",
"status": 200
}
}
上传商品图片
- 请求路径:http://localhost:8888/mss-web/photo/photoUpload
- 请求方法:post
- 请求参数
参数名 |
参数说明 |
备注 |
file |
商品 ID |
不能为空 |
{
"data": {
"fileName": "1614408446794.jpg",
"filePath": "http://localhost:8888/upload/1614408446794.jpg"
},
"meta": {
"status": 201,
"msg": "图片上传成功"
}
}