12.后台管理接口

本章节所有接口的使用需要有管理员权限。

12.1.查询老师列表

  • 请求
    manage/teachers

参数:

  • 响应

            {
                        "code": 0,
                        "data": {
                            "page": 1,
                            "page_size": 200,
                            "pages": 1,
                            "total":2,
                            "count": 2,
                            "ts": 1531909202,
                            "items": [
                                {
                                    "id": "1",
                                    "role": "1",
                                    "user_from": "zc",
                                    "server_id": "1",
                                    "outer_id": null,
                                    "phone": "15510592331",
                                    "email": "[email protected]",
                                    "name": "qqq",
                                    "sex": null,
                                    "icon": "http://img.ruiboyun.net/img/2018-07-09/o118iof0b5lg324t.jpg",
                                    "status": "1",
                                    "c_albums": "8",
                                    "c_orders": "0",
                                    "s_orders": "0.07",
                                    "s_withdraw": "0.00",
                                    "add_time": "2018-07-05 18:57:57",
                                    "update_time": "2018-07-12 14:55:26"
                                },
                                {
                                    "id": "2",
                                    "role": "1",
                                    "user_from": "zc",
                                    "server_id": "0",
                                    "outer_id": null,
                                    "phone": "15510592331",
                                    "email": null,
                                    "name": "ymgg",
                                    "sex": null,
                                    "icon": null,
                                    "status": "1",
                                    "c_albums": "0",
                                    "c_orders": "0",
                                    "s_orders": null,
                                    "s_withdraw": "0.00",
                                    "add_time": "2018-07-05 18:58:54",
                                    "update_time": "2018-07-05 18:58:54"
                                }
                            ]
                        }
                    }

与查询用户接口相比,增加四个属性:
c_albums 发布的课程总数
c_orders 售出的订单总数
s_orders 售出的总额
s_withdraw 提现的总额

12.2.查询学生列表

  • 请求
    manage/students

参数:

  • 响应

            {
                        "code": 0,
                        "data": {
                            "page": 1,
                            "page_size": 200,
                            "pages": 1,
                            "total":2,
                            "count": 2,
                            "ts": 1531909202,
                            "items": [
                                {
            "id": "3",
            "role": "2",
            "user_from": "zc",
            "server_id": "0",
            "outer_id": null,
            "phone": "18612035829",
            "email": null,
            "name": "王毅",
            "sex": null,
            "icon": null,
            "status": "1",
            "c_orders": "0",
            "s_orders": null,
            "add_time": "2018-07-06 16:17:01",
            "update_time": "2018-07-06 16:17:01"
        },
        {
            "id": "5",
            "role": "2",
            "user_from": "zc",
            "server_id": "0",
            "outer_id": null,
            "phone": "13153313602",
            "email": null,
            "name": "ggg",
            "sex": null,
            "icon": null,
            "status": "1",
            "c_orders": "6",
            "s_orders": "0.02",
            "add_time": "2018-07-10 15:06:10",
            "update_time": "2018-07-10 15:06:10"
        },
                            ]
                        }
                    }

c_orders 购买的总数
s_orders 购买的消费的总额

12.3.查询用户信息

  • 请求
    manage/user

参数:
id 用户编号,可以查询老师或学生。

  • 响应

            {
                "code": 0,
                "data": {
                    "count": 1,
                    "ts": 1531982461,
                    "items": [
                        {
                            "id": "8",
                            "org_id": "0",
                            "server_id": "1",
                            "role": "1",
                            "user_from": "zc",
                            "outer_id": null,
                            "phone": "18310567647",
                            "email": null,
                            "password": null,
                            "name": "占青青",
                            "sex": null,
                            "icon": null,
                            "birthday": null,
                            "qq": null,
                            "address": null,
                            "comment": null,
                            "maintext": null,
                            "status": "1",
                            "add_time": "2018-07-10 17:38:36",
                            "update_time": "2018-07-10 17:39:07",
                            "c_albums": "15",
                            "c_orders": "10",
                            "s_orders": "0.00",
                        }
                    ]
                }
            }

12.4.禁用和启用用户

可以用于禁用/启用:学生、老师或管理员

  • 请求
  • 禁用
    manage/disableUser
  • 启用
    manage/enableUser

参数:
id 用户编号

  • 响应

            {
                "code": 0,
            }

12.5.禁用和启用课程

  • 请求
  • 禁用
    manage/disableAlbum
  • 启用
    manage/enableAlbum

参数:
id 课程编号

  • 响应

            {
                "code": 0,
            }

12.6.查询课程列表

查询平台所有课程信息,包含订购数和销售额。

  • 请求
    manage/albums

参数:
type 类型,0 = 点播 1 = 直播
user_id 发布者编号(教师编号)
status 0=编辑中的 5=申请上线的 1=上线的 2=禁用的。 省略返回所有

  • 响应

            {
                    "code": 0,
                    "data": {
                        "page": 1,
                        "page_size": "2",
                        "pages": 13,
                        "total": 25,
                        "count": 2,
                        "ts": 1532328965,
                        "items": [
                            {
                                "id": "1",
                                "catalog_id": "101",
                                "user_id": "1",
                                "name": "测试支付1",
                                "item_num": "1",
                                "cover": "http://img.ruiboyun.net/img/2018-07-09/r79a6939ygecg1th.jpg",
                                "mediatype": "1",
                                "price": "0.01",
                                "buy_num": "0",
                                "zan_num": "1",
                                "love_num": "2",
                                "start_time": "2018-07-05 19:03:48",
                                "end_time": "2018-07-05 19:03:50",
                                "add_time": "2018-07-05 18:59:38",
                                "update_time": "2018-07-18 19:15:17",
                                "status": "1",
                                "live_status": "0",
                                "c_orders": "2",
                                "s_orders": "0.02"
                            },
                            {
                                "id": "2",
                                "catalog_id": "101",
                                "user_id": "1",
                                "name": "测试支付",
                                "item_num": "1",
                                "cover": "http://img.ruiboyun.net/img/2018-07-09/zbsze16blzzdc7tt.jpg",
                                "mediatype": "1",
                                "price": "0.01",
                                "buy_num": "1",
                                "zan_num": "3",
                                "love_num": "3",
                                "start_time": "2018-07-05 19:03:48",
                                "end_time": "2018-07-05 19:03:50",
                                "add_time": "2018-07-05 19:02:24",
                                "update_time": "2018-07-20 18:43:58",
                                "status": "1",
                                "live_status": "0",
                                "c_orders": "2",
                                "s_orders": "0.02"
                            }
                        ]
                    }
                }

该接口增加两个属性:
c_orders 订购数
s_orders 订购收入

12.7.查询某个课程信息

查询平台所有课程信息,包含订购数和销售额。

  • 请求
    manage/album

参数:
id 课程编号

  • 响应
    返回一个课程的信息。与查询列表相比增加 maintext (详细介绍)属性。

12.8.查询课程的课时

查询平台所有课程信息,包含订购数和销售额。

  • 请求
    manage/ress

参数:
album_id 课程编号

  • 响应

                {
                    "code": 0,
                    "data": {
                        "count": 2,
                        "ts": 1532685745,
                        "items": [
                            {
                                "id": "46",
                                "album_id": "26",
                                "user_id": "7",
                                "mediatype": "1",
                                "name": "第1课 ",
                                "seq": "1",
                                "cover": "http://img.ruiboyun.net/img/2018-07-16/cl3iq817d7zoamna.jpg",
                                "start_time": "2018-07-16 00:03:05",
                                "end_time": "2018-07-17 23:59:59",
                                "kan_num": "1",
                                "zan_num": "0",
                                "duration": null,
                                "size": "0",
                                "add_time": "2018-07-16 12:40:58",
                                "update_time": "2018-07-19 18:55:48",
                                "status": "1",
                                "live_status": "0",
                                "media_bind": "1"
                            },
                            {
                                "id": "47",
                                "album_id": "26",
                                "user_id": "7",
                                "mediatype": "1",
                                "name": "第2课 ",
                                "seq": "3",
                                "cover": "",
                                "start_time": "2018-07-16 00:00:00",
                                "end_time": "2018-07-17 00:00:00",
                                "kan_num": "0",
                                "zan_num": "0",
                                "duration": null,
                                "size": "0",
                                "add_time": "2018-07-16 12:40:58",
                                "update_time": "2018-07-23 18:58:28",
                                "status": "1",
                                "live_status": "0",
                                "media_bind": "1"
                            }
                        ]
                    }
                }

12.9.推荐课程

  • 请求
    /manage/recommand

参数:
id 课程编号

  • 响应

            {
                "code": 0,
            }

12.10.取消推荐课程

  • 请求
    /manage/unrecommand

参数:
id 课程编号

  • 响应

            {
                "code": 0,
            }

12.11.获取推荐课程列表

  • 请求
    /manage/listRecommand

参数:
id 课程编号

  • 响应
    同查询课程列表。

                {
                    "code": 0,
                    "data": {
                        "count": 2,
                        "ts": 1534563295,
                        "items": [
                            {
                                "id": "1",
                                "catalog_id": "101",
                                "user_id": "1",
                                "name": "测试支付1",
                                "item_num": "1",
                                "cover": "http://img.ruiboyun.net/img/2018-07-09/r79a6939ygecg1th.jpg",
                                "mediatype": "1",
                                "price": "0.01",
                                "buy_num": "3",
                                "zan_num": "4",
                                "love_num": "4",
                                "start_time": "2018-07-05 19:03:48",
                                "end_time": "2018-07-05 19:03:50",
                                "add_time": "2018-07-05 18:59:38",
                                "update_time": "2018-08-17 16:58:13",
                                "status": "1",
                                "live_status": "0",
                                "recommend": "1"
                            },
                            {
                                "id": "10",
                                "catalog_id": "101",
                                "user_id": "8",
                                "name": "数学特训",
                                "item_num": "3",
                                "cover": "http://img.ruiboyun.net/img/2018-07-10/xgrgw94f7b78o18u.jpg",
                                "mediatype": "0",
                                "price": "0.00",
                                "buy_num": "6",
                                "zan_num": "8",
                                "love_num": "2",
                                "start_time": "2018-07-10 18:08:30",
                                "end_time": "2018-07-12 00:00:00",
                                "add_time": "2018-07-10 18:09:34",
                                "update_time": "2018-08-17 12:23:12",
                                "status": "1",
                                "live_status": "0",
                                "recommend": "1"
                            }
                        ]
                    }
                }

recommend 推荐状态 1推荐 0 未推荐

12.12.添加后台管理员

  • 请求
    /manage/addManager

参数:
name 姓名
phone 手机号
password 密码
email 邮箱

  • 响应

            {
                "code": 0,
            }

12.13.查询后台管理员

返回管理员列表

  • 请求
    /manage/managers

参数:

  • 响应

        {
                    "code": 0,
                    "data": {
                        "page": 1,
                        "page_size": 20,
                        "pages": 1,
                        "total": 1,
                        "count": 1,
                        "ts": 1535016932,
                        "items": [
                            {
                                "id": "33",
                                "role": "8",
                                "outer_id": null,
                                "phone": "13666666666",
                                "email": null,
                                "name": "王建",
                                "sex": null,
                                "icon": null,
                                "status": "1",
                                "add_time": "2018-08-23 17:30:00",
                                "update_time": "2018-08-23 17:30:00"
                            }
                        ]
                    }
                }

12.14.后台管理分类(禁用/启用)

后台管理 分类(禁用/启用)

  • 请求

    /manage/useCatalog
    参数:

    id 【必选】分类ID
    type 【必选】 1 启用 2 禁用

  • 响应
    {
    "code": 0
    }

12.15.后台管理分类排序功能

后台管理 分类排序功能

  • 请求

    /manage/sortCatalog
    参数:

    obj 【必选】 json串

  • 响应
    {
    "code": 0
    }

12.16.后台管理新增老师功能

后台管理 新增老师功能

  • 请求

    /manage/addTeachers
    参数:

    name 【必选】 姓名
    phone 【必选】 手机
    org_id 【非必选】 机构
    password 【必选】 设置密码

  • 响应
    {
    "code": 0
    }

12.17.后台管理新增学生功能

后台管理 新增学生功能

  • 请求

    /manage/addStudents
    参数:

    name 【必选】 姓名
    phone 【必选】 手机
    org_id 【非必选】 机构
    password 【必选】 设置密码

  • 响应
    {
    "code": 0
    }

12.18.评论列表

查询课程下所有评论。

  • 请求

    /catalog/catalogIndex
    参数:
    id 【必选】分类ID。

  • 响应
        {
            "code": 0,
            "data": {
                "count": 1,
                "ts": 1529057248,
                "items": [
                    {
                        "id": "3",
                        "name": "名师课堂",
                        "parent_id": "0",
                        "cover": null,
                        "comment": null,
                        "add_time": "2018-08-18 14:55:54",
                        "update_time": "2019-03-28 17:52:26",
                        "status": "1",
                        "rank_sort": "0"
                    }
                ]
            }
        }

12.19.我的中心修改个人信息功能

我的中心 修改个人信息

  • 请求

    /users/personEdit
    参数:
    id 必传
    name 必传
    sex 必传
    email 必传
    icon 必传
    address
    maintext
    comment

  • 响应
    {
    "code": 0
    }