Пример #1
0
    async def post(self, request, pk):
        """
        @api {post} /follow/<pk:int> 用户关注
        @apiVersion 0.0.1
        @apiName Follow
        @apiDescription 关注某个用户
        @apiGroup User

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 49
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": "Success"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 62
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1000,
            "message": "系统错误"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 401 Unauthorized
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1001,
            "message": "账号或密码错误"
        }

        """
        current_user = request.get('current_user')
        follow_user = await User.db_get(id=pk)
        follow_record = await Follow.db_get(follower_id=current_user.id,
                                            followed_id=follow_user.id)
        if not follow_user:
            return json(Response.make(code=1005), status=400)
        result = await current_user.follow(follow_record=follow_record,
                                           follow_user=follow_user,
                                           current_user=current_user)
        if not result:
            return json(Response.make(code=1000), status=400)
        return json(Response.make(result='success'), status=200)
Пример #2
0
    async def delete(self, request, blog_id):
        """
        @api {delete} /blogs/<blog_id:int> 删除博客
        @apiVersion 0.0.1
        @apiName delete-blog
        @apiDescription 删除博客
        @apiGroup Blog

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 280
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 50
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1003,
            "message": "权限不足"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1005,
            "message": "请求资源不存在"
        }
        """
        current_user = request.get('current_user')
        blog = await Blog.db_get(id=blog_id, is_delete=False)
        if not blog:
            return json(Response.make(code=1005), status=400)

        if not current_user.id == blog.author_id:
            return json(Response.make(code=1003), status=400)

        blog_n = await blog.db_update(is_delete=True)
        if not blog_n:
            return json(Response.make(code=1004), status=400)
        return json(Response.make())
Пример #3
0
    async def delete(self, request, comment_id):
        """
        @api {delete} /blogs/<blog_id:int>/comments 删除博客评论
        @apiVersion 0.0.1
        @apiName Delete-Blog-comment
        @apiDescription 删除一个博客的评论一个评论
        @apiGroup Comment

        @apiSuccessExample {json} Success-response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 233
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1005,
            "message": "请求资源不存在"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1003,
            "message": "数据库错误"
        }
        """
        comment = await Comment.db_get(id=comment_id, is_delete=False)
        if not comment:
            return json(Response.make(code=1005), status=400)

        if not comment.author == request.get('current_user'):
            return json(Response.make(code=1003), status=400)
        await comment.db_update(is_delete=True)
        return json(Response.make())
Пример #4
0
        def decorator(*args, **kwargs):
            if args:
                request = args[0]
                if not request.get('current_user') and permission.upper() == 'LOGIN':
                    return json(Response.make(code=1001), status=401)

            return f(*args, **kwargs)
Пример #5
0
 async def post(self, request):
     current_user = request.get('current_user')
     self._check_request(request, UserSchema)
     if self.error:
         return self.error_resp
     current_user = await current_user.db_update(active=False)
     if not current_user:
         return json(Response.make(code=1004), status=400)
     return await self.get(request)
Пример #6
0
    async def get(self, request, blog_id):
        """
        @api {get} /blogs/<blog_id:int> 查看单个博客内容
        @apiVersion 0.0.1
        @apiName Single-blog
        @apiDescription 查询单个博客的具体内容
        @apiGroup Blog

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 280
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": {
                "author": {
                    "follow_value": 0,
                    "followed_value": 0,
                    "gender": 2,
                    "id": 1,
                    "username": "******"
                },
                "content": "yyyyyy",
                "create_time": "20:20:01.730670+00:00",
                "id": 1,
                "is_delete": false,
                "last_update_time": "20:20:01.730676+00:00",
                "like_value": 0,
                "title": "wwwww"
            }
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 120
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1000,
            "message": "系统错误"
        }
        """
        blog = await Blog.db_get(id=blog_id, is_delete=False)
        self._check_data(blog, BlogsSchema())
        if self.error:
            return self.error_resp

        return json(Response.make(result=self.response_arg))
Пример #7
0
    async def get(self, request, pk):
        """
        @api {get} /<pk:int>/info 用户信息
        @apiVersion 0.0.1
        @apiName user-info
        @apiDescription 获取某一用户的信息
        @apiGroup User

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 193
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": {
                "create_time": "09:22:56.251781+00:00",
                "follow_value": 0,
                "followed_value": 0,
                "gender": 2,
                "id": 1,
                "last_login_time": "09:22:56.251787+00:00",
                "username": "******"
            }
        }

        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 120
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1002,
            "message": "请求参数有误",
            "result": {
                "content": [
                    "Missing data for required field."
                ]
            }
        }
        """
        users = await User.db_get(id=pk)
        self._check_data(users, UserSchema())
        if self.error:
            return self.error_resp

        return json(Response.make(result=self.response_arg))
Пример #8
0
 async def auth_require(request):
     authorization = request.headers.get('authorization')
     if authorization:
         _, token = authorization.split(" ")
         if _.upper() == 'TOKEN':
             with await request.app.redis as coon:
                 redis_token, user_id = await coon.hmget(token, 'key', 'id')
                 if redis_token:
                     if redis_token.decode() == token:
                         request['current_user'] = await User.db_get(
                             id=user_id.decode())
                     else:
                         return json(Response.make(code=1001), status=401)
Пример #9
0
    async def post(self, request, blog_id):
        """
        @api {post} /blogs/<blog_id:int>/comments 博客评论
        @apiVersion 0.0.1
        @apiName Post-comment
        @apiDescription 评论一个博客的评论
        @apiGroup Comment

        @apiSuccessExample {json} Success-response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 233
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": [
                {
                    "author": {
                        "follow_value": 0,
                        "followed_value": 0,
                        "gender": 2,
                        "id": 1,
                        "username": "******"
                    },
                    "blog": 1,
                    "content": "yyyyyuu",
                    "create_time": "20:20:11.777450+00:00",
                    "id": 1,
                    "is_delete": false,
                    "like_value": 0
                }
            ]
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1005,
            "message": "请求资源不存在"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1004,
            "message": "数据库错误"
        }
        """
        self._check_request(request, CommentSchema)
        if self.error:
            return self.error_resp

        blog = await Blog.db_get(id=blog_id, is_delete=False)
        if not blog:
            return json(Response.make(code=1005), status=400)
        author = request.get('current_user')

        comment = await Comment.db_create(blog=blog,
                                          author=author,
                                          **self.request_arg)
        if not comment:
            return json(Response.make(code=1004), status=400)

        return await self.get(request, blog_id)
Пример #10
0
    async def patch(self, request, blog_id):
        """
        @api {patch} /blogs/<blog_id:int> 修改博客数据
        @apiVersion 0.0.1
        @apiName update-blog
        @apiDescription 修改博客的数据
        @apiGroup Blog

        @apiParam {string} [title] 博客标题
        @apiParam {string} [content] 博客内容

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 280
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": {
                "author": {
                    "follow_value": 0,
                    "followed_value": 0,
                    "gender": 2,
                    "id": 1,
                    "username": "******"
                },
                "content": "yyyyyy",
                "create_time": "20:20:01.730670+00:00",
                "id": 1,
                "is_delete": false,
                "last_update_time": "20:20:01.730676+00:00",
                "like_value": 0,
                "title": "wwwww"
            }
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 50
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1003,
            "message": "权限不足"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1005,
            "message": "请求资源不存在"
        }
        """
        current_user = request.get('current_user')
        self._check_request(request, PatchBlogSchema)
        if self.error:
            return self.error_resp

        blog = await Blog.db_get(id=blog_id, is_delete=False)
        if not blog:
            return json(Response.make(code=1005), status=400)

        if not current_user.id == blog.author_id:
            return json(Response.make(code=1003), status=400)

        blog_n = await blog.db_update(**self.request_arg)
        if not blog_n:
            return json(Response.make(code=1004), status=400)
        return await self.get(request, blog_id)
Пример #11
0
    async def get(self, request):
        """
        @api {get} /my/blogs 我的博客
        @apiVersion 0.0.1
        @apiName my-blogs
        @apiDescription 获取我的博客
        @apiGroup Blog

        @apiParam {String} [sort=create_time] 排序条件
        @apiParam {Integer} [page=1] 页码
        @apiParam {Integer} [count=10] 每页数量
        @apiParam {Integer=0,1} [desc=0] 是否倒序排列

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 193
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": {
                "author": {
                    "follow_value": 0,
                    "followed_value": 0,
                    "gender": 2,
                    "id": 1,
                    "username": "******"
                },
                "blogs": [
                    {
                        "content": "lallala",
                        "create_time": "11:27:59.981733+00:00",
                        "id": 1,
                        "like_value": 0,
                        "title": "llalalla"
                    }
                ]
            }
        }


        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 120
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1000,
            "message": "系统错误"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 401 Unauthorized
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1001,
            "message": "账号或密码错误"
        }
        """
        self._check_request(request, PageSchema)
        if self.error:
            return self.error_resp
        current_user = request.get('current_user')
        blogs = await Blog.get_by(**self.request_arg,
                                  author=current_user,
                                  is_delete=False)
        self._check_data(blogs, BaseBlogSchema(many=True))
        if self.error:
            return self.error_resp

        result = {"blogs": self.response_arg}

        self._check_data(current_user, BaseUserSchema())
        if self.error:
            return self.error_resp
        result.update({"author": self.response_arg})

        return json(Response.make(result=result))
Пример #12
0
    async def get(self, request, pk):
        """
       @api {get} /<pk:int>/blogs 用户博客查询
       @apiVersion 0.0.1
       @apiName user-blogs
       @apiDescription 查询用户博客
       @apiGroup User

       @apiParam {String} [sort=create_time] 排序条件
       @apiParam {Integer} [page=1] 页码
       @apiParam {Integer} [count=10] 每页数量
       @apiParam {Integer=0,1} [desc=0] 是否倒序排列

       @apiSuccessExample {json} Success-Response:
       HTTP/1.1 200 OK
       Connection: keep-alive
       Content-Length: 253
       Content-Type: application/json
       Keep-Alive: 60

       {
           "code": 0,
           "message": "success",
           "result": {
                 "author": {
                    "follow_value": 0,
                    "followed_value": 0,
                    "gender": 2,
                    "id": 1,
                    "username": "******"
                 },
                 "blogs": [
                     {
                        "content": "lallala",
                        "create_time": "11:27:59.981733+00:00",
                        "id": 1,
                        "like_value": 0,
                        "title": "llalalla"
                     }
                 ]
            }

       }

       @apiErrorExample {json} Error-Response:
       HTTP/1.1 400 Bad Request
       Connection: keep-alive
       Content-Length: 62
       Content-Type: application/json
       Keep-Alive: 60

       {
           "code": 1000,
           "message": "系统错误"
       }
       """
        self._check_request(request, PageSchema)
        user = await User.db_get(id=pk)
        blogs = await Blog.get_by(**self.request_arg,
                                  author=user,
                                  is_delete=False)
        if not blogs:
            return json(Response.make(code=1002), status=400)
        self._check_data(blogs, BaseBlogSchema(many=True))
        if self.error:
            return self.error_resp

        result = {"blogs": self.response_arg}

        self._check_data(user, BaseUserSchema())
        if self.error:
            return self.error_resp
        result.update({"author": self.response_arg})

        return json(Response.make(result=result))
Пример #13
0
    async def post(self, request):
        """
        @api {post} /blog 博客发布
        @apiVersion 0.0.1
        @apiName blog-create
        @apiDescription 发布博客
        @apiGroup Blog

        @apiParam {string} title blog标题
        @apiParam {string} content blog内容

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 49
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": {
                "content": "firstjob",
                "title": "lalalla"
            }

        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 62
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1000,
            "message": "系统错误"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 401 Unauthorized
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1001,
            "message": "账号或密码错误"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 120
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1002,
            "message": "请求参数有误",
            "result": {
                "content": [
                    "Missing data for required field."
                ]
            }
        }

        """
        current_user = request['current_user']
        self._check_request(request, BlogSchema)
        if self.error:
            return self.error_resp

        blog = await Blog.db_create(author=current_user, **self.request_arg)
        if not blog:
            return json(Response.make(code=1000), status=400)

        self._check_data(blog, BlogSchema())
        if self.error:
            return self.error_resp

        return json(Response.make(result=self.response_arg))
Пример #14
0
    async def get(self, request):
        """
        @api {post} /blogs 博客查询
        @apiVersion 0.0.1
        @apiName Blogs-get
        @apiDescription 查询博客
        @apiGroup Blog

        @apiParam {String} [sort=create_time] 排序条件
        @apiParam {Integer} [page=1] 页码
        @apiParam {Integer} [count=10] 每页数量
        @apiParam {Integer=0,1} [desc=0] 是否倒序排列

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 253
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": [
                {
                    "author": {
                        "email": "*****@*****.**",
                        "id": 1,
                        "username": "******"
                    },
                    "content": "firstjob",
                    "title": "lalalla"
                },
                {
                    "author": {
                        "email": "*****@*****.**",
                        "id": 1,
                        "username": "******"
                    },
                    "content": "firstjob",
                    "title": "lalalla"
                }
            ]
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 62
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1000,
            "message": "系统错误"
        }
        """
        self._check_request(request, PageSchema)

        blogs = await Blog.get_by(**self.request_arg, is_delete=False)
        self._check_data(blogs, BlogsSchema(many=True))
        if self.error:
            return self.error_resp
        return json(Response.make(result=self.response_arg))
Пример #15
0
    async def patch(self, request):
        """
        @api {patch} /my/info 修改我的信息
        @apiVersion 0.0.1
        @apiName my-info-patch
        @apiDescription 对个人信息修改
        @apiGroup My

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 193
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": {
                "create_time": "09:22:56.251781+00:00",
                "follow_value": 0,
                "followed_value": 0,
                "gender": 2,
                "id": 1,
                "last_login_time": "09:22:56.251787+00:00",
                "username": "******"
            }
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 120
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1002,
            "message": "请求参数有误",
            "result": {
                "content": [
                    "Missing data for required field."
                ]
            }
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 401 Unauthorized
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1001,
            "message": "账号或密码错误"
        }
        """
        current_user = request.get('current_user')
        self._check_request(request, UserSchema)
        if self.error:
            return self.error_resp
        current_user = await current_user.db_update(**self.request_arg)
        if not current_user:
            return json(Response.make(code=1004), status=400)
        return await self.get(request)
Пример #16
0
    async def get(self, request, blog_id):
        """
        @api {get} /blogs/<blog_id:int>/comments 查询博客评论
        @apiVersion 0.0.1
        @apiName Blog-comments
        @apiDescription 查询一个博客的评论
        @apiGroup Comment

        @apiParam {String} [sort=create_time] 排序条件
        @apiParam {Integer} [page=1] 页码
        @apiParam {Integer} [count=10] 每页数量
        @apiParam {Integer=0,1} [desc=0] 是否倒序排列

        @apiSuccessExample {json} Success-response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 233
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": [
                {
                    "author": {
                        "follow_value": 0,
                        "followed_value": 0,
                        "gender": 2,
                        "id": 1,
                        "username": "******"
                    },
                    "blog": 1,
                    "content": "yyyyyuu",
                    "create_time": "20:20:11.777450+00:00",
                    "id": 1,
                    "is_delete": false,
                    "like_value": 0
                }
            ]
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1005,
            "message": "请求资源不存在"
        }
        """
        self._check_request(request, PageSchema)
        blog = await Blog.db_get(id=blog_id, is_delete=False)
        if not blog:
            return json(Response.make(code=1005), status=400)

        comments = await Comment.get_by(**self.request_arg, blog=blog)

        self._check_data(comments, CommentSchema(many=True))
        if self.error:
            return self.error_resp

        return json(Response.make(result=self.response_arg))
Пример #17
0
    async def get(self, request):
        """
        @api {get} /my/info 获取我的信息
        @apiVersion 0.0.1
        @apiName my-info
        @apiDescription 获取我的个人信息
        @apiGroup My

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 193
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": {
                "create_time": "09:22:56.251781+00:00",
                "email": "*****@*****.**",
                "follow_value": 0,
                "followed_value": 0,
                "gender": 2,
                "id": 1,
                "last_login_time": "09:22:56.251787+00:00",
                "username": "******"
            }
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 120
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1002,
            "message": "请求参数有误",
            "result": {
                "content": [
                    "Missing data for required field."
                ]
            }
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 401 Unauthorized
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1001,
            "message": "账号或密码错误"
        }
        """
        current_user = request.get('current_user')
        user = await User.db_get(id=current_user.id)
        self._check_data(user, MyInfoSchema())
        if self.error:
            return self.error_resp

        return json(Response.make(result=self.response_arg))
Пример #18
0
    async def get(self, request):
        """
        @api {post} /my/follow 关注我的用户
        @apiVersion 0.0.1
        @apiName Follow-Me
        @apiDescription 关注的我用户
        @apiGroup My

        @apiSuccessExample {json} Success-Response:
        HTTP/1.1 200 OK
        Connection: keep-alive
        Content-Length: 128
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 0,
            "message": "success",
            "result": [
                {
                    "follower": {
                        "follow_value": 1,
                        "followed_value": 0,
                        "gender": 2,
                        "id": 1,
                        "username": "******"
                    }
                }
            ]
        }


        @apiErrorExample {json} Error-Response:
        HTTP/1.1 400 Bad Request
        Connection: keep-alive
        Content-Length: 62
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1000,
            "message": "系统错误"
        }

        @apiErrorExample {json} Error-Response:
        HTTP/1.1 401 Unauthorized
        Connection: keep-alive
        Content-Length: 68
        Content-Type: application/json
        Keep-Alive: 60

        {
            "code": 1001,
            "message": "账号或密码错误"
        }
        """
        self._check_request(request, PageSchema)
        if self.error:
            return self.error_resp
        current_user = request.get('current_user')
        followed_users = await Follow.get_by(**self.request_arg,
                                             followed=current_user)
        self._check_data(followed_users, FollowerSchema(many=True))
        if self.error:
            return self.error_resp

        return json(Response.make(result=self.response_arg))