美文网首页
数据库表以及接口设计思路(二)

数据库表以及接口设计思路(二)

作者: 跑者小越 | 来源:发表于2018-01-23 13:27 被阅读267次

    和多雨把数据库的表定下来了,下一步把页面都画出来,把业务逻辑理一理。


    主页(登陆后)pc 第三方接入弹框

    基础功能:

    1. 登陆(github第三方)

    2. 获取用户信息(用户id,昵称,头像,暂不提供修改信息功能)

    3. 创建谱册(只输入谱册名称,快速创建,后面再补充其他信息,封面为默认图片,默认不公开)

    4. 谱册列表(谱册名称、封面图片)

    5. 获取单个谱册信息(谱册名称、简介、封面图片、标签数组、包含的谱子列表)

    6. 单个谱册信息修改(谱册名称、简介、封面图片、是否公开、标签数组的删除与增加 [ 最多3个标签,可以没有 ])

    7. 往单个谱册中添加谱子/往收藏夹里添加谱子

    8. 删除单个谱册中的谱子

    9. 删除单个谱册

    进阶功能:

    1. 收藏别人的谱册

    2. 取消收藏别人的谱册

    3. 收藏谱册列表

    1. 热门谱册列表(按收藏人数降序列出所有用户的公开谱册:谱册名称、封面图片、被收藏次数、标签数组)
    1. 最新谱册列表(按创建时间降序列出所有用户的公开谱册:谱册名称、封面图片、创建时间)
    网站目录
    {
      {
        "vid": 1,
        "name": "2018年01月新番精选",
        "cover": "https://user-images.githubusercontent.com/35213527/35343025-8dbb8604-0164-11e8-9ee9-107ed45359c7.png",
        "describe": "I'm having a problem with this.",
        "uid": 1,
        "label":[
            "新番",
            "老番"
          ],
        "status":0,
        "create_date":@date
      },
      {
        "vid": 1,
        "name": "2018年01月新番精选",
        "cover": "https://user-images.githubusercontent.com/35213527/35343025-8dbb8604-0164-11e8-9ee9-107ed45359c7.png",
        "describe": "I'm having a problem with this.",
        "uid": 1,
        "label":[
            "新番",
            "老番"
          ],
        "status":0,
        "create_date":@date
      },
      {
        "vid": 1,
        "name": "2018年01月新番精选",
        "cover": "https://user-images.githubusercontent.com/35213527/35343025-8dbb8604-0164-11e8-9ee9-107ed45359c7.png",
        "describe": "I'm having a problem with this.",
        "uid": 1,
        "label":[
            "新番",
            "老番"
          ],
        "status":0,
        "create_date":@date
      }
    }
    

    接口

    users

    1. Get an user information(需验证)
      GET /users/:uid/info

    favorite

    1. List scores in a favorite
      GET /users/:uid/favorite

    2. Add a score to a favorite (需验证)
      POST /users/:uid/favorite/scores

    3. Delete a score from a favorite (需验证)
      DELETE /users/:uid/favorite/scores/:sid

    volumes

    1. List volumes
      GET /volumes

    2. List volumes created by a user
      GET /users/:uid/volumes

    3. Get a single volume
      GET /volumes/:vid

    4. Create a volume
      POST /volumes

    5. Edit a volume (需验证)
      PATCH /volumes/:vid

    6. Delete a volume (需验证)
      DELETE /volumes/:vid

    7. List scores in a volume
      GET /volumes/:vid/scores

    8. Add a score to a volume (需验证)
      POST /volumes/:vid/scores

    9. Delete a score from a volume (需验证)
      DELETE /volumes/:vid/scores/:sid

    search

    1. Search volumes
      GET /search/volumes

    按时间排序
    GET /search/volumes?status=1&sort=created&order=desc

    GET /search/volumes?label=新番&status=1&sort=created&order=desc

    Name Type Description
    label string Filter volumes based on their labels.
    status TINYINT(4) Filter volumes based on their status. 0:deleted,1:public,2:private,3:reviewed.Default: 1.
    sort string The sort field. Can be comments, created. Default: results are sorted by best match.
    order string The sort order if sort parameter is provided. One of asc or desc. Default: desc

    相关文章

      网友评论

          本文标题:数据库表以及接口设计思路(二)

          本文链接:https://www.haomeiwen.com/subject/jhrsaxtx.html