Open RandnYC opened 5 years ago
base_url为http://localhost:8080
http://host/api/manager/login
//method: post
//body
{
"userId": "account"
"passwd": "VzEIxwQU"
}
//response
{
"status": "success",
"message": null,
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMDAxIiwiZXhwIjoxNTY0Nzk2NTAzLCJpYXQiOjE1NjQzNjQ1MDN9.ci2cJvcsZPWk8v4xksFfsiisQVdLr1lzfVEISD91UntioEMSpqwwIfSx6Rv-Y0vDXeI2seNvYupc-d9gH-D4Sw",
"identity": null,
"userName": null,
"userId": "1001"
}
}
若登录成功后服务器请重定向页面(后端只返回状态,不重定向)
http://host/path/to/home.html #前端重定向
host/api/manager/awards/list
//method: post
//headers
Authorization: “your token”
//body
userId: “管理员ID”
//response
{
"status": "success",
"message": null,
"data": [
{
"id": 2,
"adminId": 1,
"title": "测试奖品",
"cnt": 200,
"remain": 0,
"stepNeed": 100,
"content": "...",
"srcUrl": null,
"releaseTime": "2019-07-17",
"redeemed": null(对管理员来说没用),
"available": null(对管理员来说没用)
},
{
"id": 3,
"adminId": 1,
"title": "iponeX",
"cnt": 50,
"remain": 5,
"stepNeed": 1000,
"content": "...",
"srcUrl": null,
"releaseTime": "2019-07-16",
"redeemed": null,
"available": null
}
]
}
http://host/api/manager/awards/update
//method: post
//headers
Authorization: “your token”
//body
userId: “管理员ID”
img: “图片路径”
name: “奖品名称”
desc: ”奖品文字描述”
step: “步数要求”
cnt: “数量”
//response
{
"status": "success",
"message": null,
"data": "添加成功"
}
host/api/manager/awards/delete
//method: post
//headers
Authorization: “your token”
//body
userId: “管理员ID”
prizeId: “礼品id”
//response
{
"status": "success",
"message": null,
"data": "删除成功"
}
等前端完成..
host/api/manager/users/list
//method: post
//headers:
Authorization: “your token”
//body
userId: “管理员ID”
//response
{
"status": "success",
"message": null,
"data": [
{
"id": 1000,
"num": "16124332",
"username": "xwl",
"type": 1,
"device": "Mi10",
"registTime": "2019-06-20T02:53:09.000+0000",
"email": "",
"todayStep": 106,
"weekStep": 10204,
"monthStep": 10304,
"seasonStep": 10404,
"totalStep": 11111,
"iconPath": "",
"bgPath": "mybg"
},
{
"id": 1001,
"num": "1101",
"username": "裏",
"type": 1,
"device": "ipone5",
"registTime": "2019-06-11T02:54:42.000+0000",
"email": null,
"todayStep": 5,
"weekStep": null,
"monthStep": null,
"seasonStep": null,
"totalStep": null,
"iconPath": null,
"bgPath": null
},
]
}
host/api/manager/users/update
//method: post
//Headers
Authorization: “your token”
//body
userId: “管理员ID”
updateId: “需要修改的用户ID”
type: “用户类型 0表非会员 1表会员”
//response
{
"status": "success",
"message": null,
"data": "更新成功"
}
host/api/manager/news/update
//method: post
//headers:
Authorization: “your token”
//body:
userId: “管理员ID”
content: “新闻内容”
title: “新闻标题”
img: “图片路径”
//response:
{
"status": "success",
"message": null,
"data": "添加成功"
}
host/api/manager/ticket/getAll
//method: post
//Headers:
Authorization: “your token”
//body:
userId: “管理员ID”
返回:
{
"status": "success",
"message": null,
"data": [
{
"id": 3,
"adminId": 2,
"title": "王力宏“龙的传人2060”世界巡演杭州大莲花专场",
"cnt": 5,
"remain": 2,
"content": "...",
"releaseTime": "2019-06-22",
"deadline": "2019-06-30",
"iconPath": null,
"videoPath": null,
"reDeemed": null(对管理员无用)
},
{
"id": 2,
"adminId": 1,
"title": "2019张杰【未·LIVE】全球巡回演唱会 重庆站",
"cnt": 20,
"remain": 12,
"content": "...",
"releaseTime": "2019-06-21",
"deadline": "2019-06-04",
"iconPath": null,
"videoPath": null,
"reDeemed": null
}
]
}
host/api/manager/ticket/add
//method: post
//headers
Authorization: “your token”
//body
userId: “管理员ID”
title:”票名”
cnt: “数量”
content:”内容”
img:”图片路径”
video: “视频路径”
time: “一个数字,表示过多少天失效”
//response
{
"status": "success",
"message": null,
"data": "添加成功"
}
host/api/manager/ticket/delete
//method: post
//headers
Authorization: “your token”
//body
userId: “管理员ID”
ticketId: “票ID”
//response
{
"status": "success",
"message": null,
"data": "删除成功"
}
管理员页面功能需求
路由及接口
登录
若登录成功后服务器请重定向页面
奖品
奖品列表
get方式无参请求
添加奖品
删除奖品
解决工单
等前端完成..
用户列表
请求用户列表
get方式无参请求
修改用户身份
新闻推送