From 0e908d2299d6cc3808940f6de6ff0fe909552c30 Mon Sep 17 00:00:00 2001 From: wf4867612 Date: Mon, 8 Apr 2019 23:45:39 +0800 Subject: [PATCH] add user_qc and user_r MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增了QC端的接口文档和站长接口文档 --- docs/Reference/admin/user/user_qc.md | 249 +++++++++++++++++++++++++++ docs/Reference/admin/user/user_r.md | 240 ++++++++++++++++++++++++++ 2 files changed, 489 insertions(+) diff --git a/docs/Reference/admin/user/user_qc.md b/docs/Reference/admin/user/user_qc.md index 9d1f7c0..be07b4d 100644 --- a/docs/Reference/admin/user/user_qc.md +++ b/docs/Reference/admin/user/user_qc.md @@ -1,2 +1,251 @@ # QC端用户后台管理接口 +# 获取列表 + +### URL + +后台 + +GET /adminsys/user/qc/list/ + +### 请求参数 + +| 参数名称 | 类型 | 含义 | +| --------------- | ---------------- | ---------- | +| user_id | String | 会话 | +| counte_per_page | Int(Optional) | 每页条目数 | +| page | Int(Optional) | 页码 | +| extra_filter | String(Optional) | 过滤器 | + +### 应答 + +| 字段名称 | 类型 | 含义 | +| -------------- | ------- | -------------------- | +| count_active | Int | 可用用户数量 | +| count_inactive | Int | 不可用用户数量 | +| count_all | Int | 全部用户数量 | +| qc_staffs | Flatten | 【扁平化】质检员列表 | + +### 请求例 + +获取用户名或手机号中包含"1"的质检员,每页3个,取第1页 + +```http +GET /adminsys/user/qc/list/?user_sid=pz23kuvify7z0brahp0ywne61iqinyf3&page=0&count_per_page=3&extra_filter=1 +``` + +### 应答例 + +```json +{ + "version": "2.0", + "response": { + "n_pages": 2, + "count_active": 6, + "qc_staffs": [ + { + "name": "fanhangyu", + "qc_role": "reviewer", + "user__is_active": true, + "qc_place__name": "测试场地2", + "qc_place__id": 1, + "join_date": 1548064560, + "id": 1, + "qc_place__loc_desc": "不知道aaa", + "user__pn": "18513958704" + }, + { + "name": "测试员1", + "qc_role": "reviewer", + "user__is_active": true, + "qc_place__name": "测试场地2", + "qc_place__id": 1, + "join_date": 1550032656, + "id": 2, + "qc_place__loc_desc": "不知道aaa", + "user__pn": "13888888888" + }, + { + "name": "测试员222", + "qc_role": "reviewer", + "user__is_active": true, + "qc_place__name": "测试场地2", + "qc_place__id": 1, + "join_date": 1550032674, + "id": 3, + "qc_place__loc_desc": "不知道aaa", + "user__pn": "13888888887" + } + ], + "result": 200, + "count_all": 6, + "count_inactive": 0 + }, + "context": null +} +``` + +# 获取详情 + +### URL + +后台 + +GET /adminsys/user/qc/ + +### 请求参数 + +| 参数名称 | 类型 | 含义 | +| -------- | ------ | -------- | +| user_id | String | 会话 | +| id | Int | 质检员ID | + +### 应答 + +| 字段名称 | 类型 | 含义 | +| -------- | ------- | -------------------- | +| qc_staff | Flatten | 【扁平化】质检员信息 | + +### 请求例 + +获取ID为1的已登录的质检员 + +```http +GET /adminsys/user/qc/?user_sid=pz23kuvify7z0brahp0ywne61iqinyf3&id=1 +``` + +### 应答例 + +```json +{ + "version": "2.0", + "response": { + "qc_staff": { + "name": "fanhangyu", + "qc_role": "reviewer", + "user__is_active": true, + "qc_place__name": "测试场地2", + "qc_place__id": 1, + "join_date": 1548064560, + "id": 1, + "qc_place__loc_desc": "不知道aaa", + "user__pn": "18513958704" + }, + "result": 200 + }, + "context": null +} +``` + +------ + +# 修改 + +### URL + +后台 + +PUT /adminsys/user/qc/ + +### 请求参数 + +| 参数名称 | 类型 | 含义 | +| -------- | --------------- | -------- | +| id | Int | 质检员ID | +| update | Partial Flatten | 质检员 | + +### 应答 + +无 + +### 请求例 + +```http +PUT /adminsys/user/qc/?user_sid=pz23kuvify7z0brahp0ywne61iqinyf3&id=1 +Host: - +Content-Type: application/json +cache-control: no-cache +Postman-Token: 7il3l1l3-zfgg-asom-aha0-8gxqf70kpo1c +{ + "data":{ + "id":1, + "update":{ + "name":"fanhangyu", + "qc_role": "reviewer", + "user__is_active": true, + "qc_place__name": "测试场地3", + "qc_place_id": 1, + "id":1, + "join_date": 1548064560, + "qc_place__loc_desc": "不知道ddd", + "user__pn": "18513958704" + } + } +} + +``` + +### 注释 + +修改接口的update内所有字段均为可选,更新方式为增量更新。 + +例如,update下不含user_pn,则不对质检员手机号进行更新。 + +------ + +# 新增 + +### URL + +后台 + +POST /adminsys/user/qc/ + +### 请求参数 + +| 参数名称 | 类型 | 含义 | +| -------- | ------- | ---------- | +| qc_staff | Flatten | 质检员视图 | + +### 应答 + +| 字段名称 | 类型 | 含义 | +| -------- | ---- | -------- | +| id | Int | 质检员ID | + +### 请求例 + +```http +POST /adminsys/user/qc/?user_sid=pz23kuvify7z0brahp0ywne61iqinyf3 +Host: - +Content-Type: application/json +cache-control: no-cache +Postman-Token: 7il3l1l3-zfgg-asom-aha0-8gxqf70kpo1c +{ + "data":{ + "qc_staff":{ + "name":"fanhangyu", + "qc_role": "reviewer", + "user__is_active": true, + "qc_place__name": "测试场地2", + "qc_place_id": 1, + "id":1, + "join_date": 1548064560, + "qc_place__loc_desc": "不知道ddd", + "user__pn": "18513958705" + } + } +} +``` + +### 应答例 + +{ + "version": "2.0", + "response": { + "result": 200, + "id": 7 + }, + "context": null +} + diff --git a/docs/Reference/admin/user/user_r.md b/docs/Reference/admin/user/user_r.md index c93a5fd..6d6ed58 100644 --- a/docs/Reference/admin/user/user_r.md +++ b/docs/Reference/admin/user/user_r.md @@ -1,2 +1,242 @@ # 站长后台管理接口 +# 获取列表 + +### URL + +后台 + +GET /adminsys/user/r/list/ + +### 请求参数 + +| 参数名称 | 类型 | 含义 | +| -------------- | ---------------- | ---------- | +| user_sid | String | 会话 | +| count_per_page | Int(Optional) | 每页条目数 | +| page | Int(Optional) | 页码 | +| extra_filter | String(Optional) | 过滤器 | + +### 应答 + +| 字段名称 | 类型 | 含义 | +| -------------- | ---- | -------------------- | +| count_active | Int | 可用用户数量 | +| count_inactive | Int | 不可用用户数量 | +| count_all | Int | 全部用户数量 | +| referrers | | 【扁平化】推荐人列表 | + +### 请求例 + +获取用户名或手机号中包含'1'的站长,每页3个,取第1页 + +```http +GET /adminsys/user/r/list/?user_sid=user_sid_admin&count_per_page=3&page=0&extra_filter=1 + +``` + +### 应答例 + +```json +{ + "version": "2.0", + "response": { + "n_pages": 4, + "count_active": 10, + "result": 200, + "count_all": 10, + "referrers": [ + { + "name": "樊1", + "referrer_code": "aba5a6f5dba0432aaf245b62335651d0", + "r_state": "pass", + "expire_date": 1548946500, + "operator": null, + "position": null, + "percentage": "0.0000", + "pass_date": null, + "id": 2, + "user__pn": "18513958704" + }, + { + "name": "weqweqw", + "referrer_code": "8e3d249bddcb42ffa6a415f7ba1fe99e", + "r_state": "pass", + "expire_date": 1551323820, + "operator": null, + "position": null, + "percentage": "0.0000", + "pass_date": null, + "id": 3, + "user__pn": "15900659180" + }, + { + "name": "崔玉珊", + "referrer_code": "47af18026c6b4d30bfabdfc33c227cd6", + "r_state": "pass", + "expire_date": 1864723920, + "operator": null, + "position": null, + "percentage": "0.0100", + "pass_date": null, + "id": 4, + "user__pn": "13261809966" + } + ], + "count_inactive": 0 + }, + "context": null +} +``` + +# 获取详情 + +### URL + +后台 + +GET /adminsys/user/r/qr/ + +### 请求参数 + +| 参数名称 | 类型 | 含义 | +| -------- | ------ | -------- | +| user_sid | String | 会话 | +| id | Int | 推荐人ID | + +### 应答 + +| 字段名称 | 类型 | 含义 | +| -------- | ----- | ------------ | +| qr_bin | image | 推荐人二维码 | + +### 请求列 + +获取用户名或用户手机号中推荐人ID为3的推荐人二维码 + +```http +GET /adminsys/user/r/qr/?user_sid=user_id_admin&id=3 +``` + +### 应答例 + +- ![avatar](https://backend.sandbox.bbrecycle.cn:8443/adminsys/user/r/qr/?user_sid=pz23kuvify7z0brahp0ywne61iqinyf3&id=3) + +# 获取详情 + +### URL + +后台 + +GET /adminsys/user/r/ + +### 请求参数 + +| 参数名称 | 类型 | 含义 | +| -------- | ------ | -------- | +| user_id | String | 会话 | +| id | Int | 推荐人ID | + +### 应答 + +| 字段名称 | 类型 | 含义 | +| -------- | ---- | ---------- | +| referrer | Dict | 推荐人信息 | + +### 请求例 + +获取推荐人ID为3的推荐人信息 + +```http +GET /adminsys/user/r/?user_sid=pz23kuvify7z0brahp0ywne61iqinyf3&id=3 +``` + +### 应答例 + +```json +{ + "version": "2.0", + "response": { + "referrer": { + "name": "weqweqw", + "referrer_code": "8e3d249bddcb42ffa6a415f7ba1fe99e", + "r_state": "pass", + "expire_date": 1551323899, + "operator": null, + "position": "3", + "percentage": "0.0000", + "pass_date": null, + "id": 3, + "user__pn": "15900659180" + }, + "result": 200 + }, + "context": null +} +``` + +------ + +# 修改 + +### URL + +后台 + +PUT /adminsys/user/r/ + +### 请求参数 + +| 参数名称 | 类型 | 含义 | +| -------- | --------------- | ---------- | +| id | Int | 推荐人ID | +| update | Partial Flatten | 推荐人视图 | + +### 应答 + +无 + +### 请求例 + +```http +PUT /adminsys/user/r/?user_sid=pz23kuvify7z0brahp0ywne61iqinyf3&id=3 +Host: - +Content-Type: application/json +cache-control: no-cache +Postman-Token: 7il3l1l3zf-ggas-omah-a08g-xqf70kpo1c +{ + "data":{ + "id":3, + "update":{ + "name":"weqweqw", + "percentage":"0.0000", + "expire_date":1551323899, + "r_state":"pass", + "pass_date":null, + "referrer_code":"8e3d249bddcb42ffa6a415f7ba1fe99e", + "position":"3", + "user_pn1":null, + "operator":"1", + "aaa":2 + } + } +} +``` + +### 应答例 + +表示更新成功 + +{ + "version": "2.0", + "response": { + "result": 200 + }, + "context": null +} + +### 注释 + +修改接口的update内所有字段均为可选,更新方式为增量更新。 + +例如,update下不含referrer_code,则不对推荐码进行更新。 \ No newline at end of file