@cfygaoyang
2019-06-27T07:36:16.000000Z
字数 7873
阅读 437
未分类
错误码 | 说明 |
---|---|
0 | 成功 |
10000 | 通用错误码 |
10001 | 数据未查到 |
10002 | 访问的路径不存在 |
10003 | 该用户没有访问或操作权限 |
10004 | 无效的Token, 可能是错误的, 失效的, 用户已被删除 |
10005 | 请求字段不合法 |
10006 | 用户未注册 |
10007 | 密码错误 |
10008 | 无效的验证码 |
10009 | 用户已注册 |
10010 | 短信发送太频繁 |
10011 | 短信服务欠费 |
10012 | 短信服务其他错误信息 |
10013 | 短信服务不可用, 可能是服务变更或参数错误导致 |
10014 | 邮件服务不可用, 可能是服务变更或参数错误导致 |
POST /api/auth/send_code
{
"Content-Type": "application/json; charset=utf-8"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
area | string | 否 | 手机区号 |
account | string | 是 | 手机或邮箱 |
* 请求回调
{
"code": 0,
"message": "success",
"data": {}
}
POST /api/auth/check_code
{
"Content-Type": "application/json; charset=utf-8"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
area | string | 否 | 手机区号 |
account | string | 是 | 手机或邮箱 |
code | string | 是 | 验证码 |
* 请求回调
{
"code": 0,
"message": "success",
"data": {}
}
POST /api/auth/register
{
"Content-Type": "application/json; charset=utf-8"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
area | string | 否 | 手机区号 |
account | string | 是 | 手机或邮箱 |
code | string | 是 | 验证码 |
password | string | 是 | 密码 |
* 请求回调
{
"code": 0,
"message": "success",
"data": {
"access_token": "lRnCFDxpK6PhpT44YaaLMwHmvI97GCIQvxazlNSQC4XxjDBCAV",
"refresh_token": "aQ4XO33CSez6aSXEaiptgD10NzbWMu42xh3Wvb3YI2pgpD1raD",
"expires_at": "2019-05-29 18:22:30",
"expires_in": 604800
}
}
POST /api/auth/access_token
{
"Content-Type": "application/json; charset=utf-8"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
area | string | 否 | 手机区号 |
account | string | 是 | 手机或邮箱 |
password | string | 是 | 密码 |
* 请求回调
{
"code": 0,
"message": "success",
"data": {
"access_token": "lRnCFDxpK6PhpT44YaaLMwHmvI97GCIQvxazlNSQC4XxjDBCAV",
"refresh_token": "aQ4XO33CSez6aSXEaiptgD10NzbWMu42xh3Wvb3YI2pgpD1raD",
"expires_at": "2019-05-29 18:22:30",
"expires_in": 604800
}
}
POST /api/auth/refresh_token
{
"Content-Type": "application/json; charset=utf-8"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
refresh_token | string | 是 | 刷新Token |
{
"code": 0,
"message": "success",
"data": {
"access_token": "lRnCFDxpK6PhpT44YaaLMwHmvI97GCIQvxazlNSQC4XxjDBCAV",
"refresh_token": "aQ4XO33CSez6aSXEaiptgD10NzbWMu42xh3Wvb3YI2pgpD1raD",
"expires_at": "2019-05-29 18:22:30",
"expires_in": 604800
}
}
POST /api/auth/destroy_token
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
{
"code": 0,
"message": "success",
"data": {}
}
GET /api/personal/info
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
{
"code": 0,
"message": "success",
"data": {
"id": 8,
"area": "86",
"phone": "18656660930",
"email": "",
"openid": "HuTfdXc8mENtNULFPBVt233cN2gzZ9lKqAcoUKed",
"role": 0,
"username": "18656660930",
"is_active": true,
"app_id": "",
"created_at": "2019-05-22 18:20:45",
"updated_at": "2019-05-22 18:20:45",
"nickname": "",
"avatar": "",
"gender": 2,
"birthday": "",
"address": ""
}
}
PUT /api/personal/info
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
nickname | string | 否 | 昵称 |
avatar | string | 否 | 头像地址 |
gender | int | 否 | 性别:0女,1男,2保密 |
birthday | string | 否 | 生日: 格式要求示例(1991-03-08) |
address | string | 否 | 住址 |
* 请求回调
{
"code": 0,
"message": "success",
"data": {
"id": 8,
"area": "86",
"phone": "18656660930",
"email": "",
"openid": "HuTfdXc8mENtNULFPBVt233cN2gzZ9lKqAcoUKed",
"role": 0,
"username": "18656660930",
"is_active": true,
"app_id": "",
"created_at": "2019-05-22 18:20:45",
"updated_at": "2019-05-22 18:20:45",
"nickname": "",
"avatar": "",
"gender": 2,
"birthday": "",
"address": ""
}
}
POST /api/push/bind
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
client_id | string | 是 | 客户端ID(第三方推送服务提供) |
client_type | string | 是 | 客户端类型:android, ios |
* 请求回调
{
"code": 0,
"message": "success",
"data": {
"id": 3,
"app_id": "",
"created_at": "2019-05-23 15:24:40",
"updated_at": "2019-05-23 15:24:40",
"user_id": 8,
"client_id": "xxxxxxx",
"client_type": "android",
"switch": true
}
}
GET /api/push/switch/{client_id}
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
{
"code": 0,
"message": "success",
"data": {
"id": 3,
"app_id": "",
"created_at": "2019-05-23 15:24:40",
"updated_at": "2019-05-23 15:24:40",
"user_id": 8,
"client_id": "xxxxxxx",
"client_type": "android",
"switch": true
}
}
PUT /api/push/switch/{client_id}
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
switch | boolean | 是 | 推送开关状态 |
* 请求回调
{
"code": 0,
"message": "success",
"data": {}
}
GET /api/faq
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
page_no | int | 否 | 分页数:默认1 |
page_size | int | 否 | 数据量:默认20 |
{
"code": 0,
"message": "success",
"data": {
"total": 1,
"pages": 1,
"current_page": 1,
"page_size": 20,
"data": [
{
"id": 2,
"app_id": "",
"created_at": "2019-05-23 18:17:16",
"updated_at": "2019-05-23 18:17:16",
"title": "标题",
"content": "内容",
"category": "",
"external_link": ""
}
]
}
}
GET /api/faq/{id}
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
{
"code": 0,
"message": "success",
"data": {
"id": 2,
"app_id": "",
"created_at": "2019-05-23 18:17:16",
"updated_at": "2019-05-23 18:17:16",
"title": "标题",
"content": "内容",
"category": "",
"external_link": ""
}
}
GET /api/feedback_category
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
page_no | int | 否 | 分页数:默认1 |
page_size | int | 否 | 数据量:默认20 |
{
"code": 0,
"message": "success",
"data": {
"total": 1,
"pages": 1,
"current_page": 1,
"page_size": 20,
"data": [
{
"id": 1,
"app_id": "",
"created_at": "2019-05-24 11:28:08",
"updated_at": "2019-05-24 11:30:57",
"name": "app",
"description": "app"
}
]
}
}
POST /api/feedback
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
feedback_content | string | 是 | 反馈内容 |
feedback_category_id | int | 否 | 反馈类型ID |
contact_phone | string | 否 | 联系电话) |
* 请求回调
{
"code": 0,
"message": "success",
"data": {
"id": 3,
"app_id": "",
"created_at": "2019-05-24 11:48:47",
"updated_at": "2019-05-24 11:48:47",
"feedback_content": "反馈内容",
"feedback_status": 0,
"feedback_category_id": 1,
"contact_phone": "18656660930",
"user_id": 2
}
}
DELETE /api/feedback/{id}
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
{
"code": 0,
"message": "success",
"data": {}
}
GET /api/feedback
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
page_no | int | 否 | 分页数:默认1 |
page_size | int | 否 | 数据量:默认20 |
{
"code": 0,
"message": "success",
"data": {
"total": 2,
"pages": 1,
"current_page": 1,
"page_size": 20,
"data": [
{
"id": 3,
"app_id": "",
"created_at": "2019-05-24 11:48:47",
"updated_at": "2019-05-24 11:48:47",
"feedback_content": "反馈内容",
"feedback_status": 0,
"feedback_category_id": 1,
"contact_phone": "18656660930",
"user_id": 2
},
{
"id": 2,
"app_id": "",
"created_at": "2019-05-24 11:47:43",
"updated_at": "2019-05-24 11:47:43",
"feedback_content": "反馈内容",
"feedback_status": 0,
"feedback_category_id": 1,
"contact_phone": "18656660930",
"user_id": 2
}
]
}
}
GET /api/feedback/reply/{feedback_id}
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
{
"code": 0,
"message": "success",
"data": {
"id": 2,
"app_id": "",
"created_at": "2019-05-24 14:02:44",
"updated_at": "2019-05-24 14:02:44",
"reply_content": "回复内容",
"manager_id": 2,
"feedback_id": 3,
"is_read": false
}
}
GET /api/message/count
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
push_ids | list | 是 | 推送id数组/列表,如:[1,2,3] |
* 请求回调
{
"code": 0,
"message": "success",
"data": {
"push_count": 0,
"feedback_count": 1
}
}
GET /api/push/log
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
参数 | 类型 | 必须 | 说明 |
---|---|---|---|
page_no | int | 否 | 分页数:默认1 |
page_size | int | 否 | 数据量:默认20 |
{
"code": 0,
"message": "success",
"data": {
"total": 1,
"pages": 1,
"current_page": 1,
"page_size": 20,
"data": [
{
"id": 1,
"app_id": "",
"created_at": "2019-05-30 00:00:00",
"updated_at": "2019-05-30 00:00:00",
"push_title": "推送测试",
"push_body": "推送测试内容",
"push_scope": 0,
"manager_id": 1,
"push_status": 1
}
]
}
}
GET /api/push/log/{id}
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
{
"code": 0,
"message": "success",
"data": {
"id": 1,
"app_id": "",
"created_at": "2019-05-30 00:00:00",
"updated_at": "2019-05-30 00:00:00",
"push_title": "推送测试",
"push_body": "推送测试内容",
"push_scope": 0,
"manager_id": 1
}
}
DELETE /api/push/log/delete
{
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Token xxxxxx"
}
{
"code": 0,
"message": "success",
"data": {}
}