[关闭]
@artman328 2022-06-05T01:09:25.000000Z 字数 805 阅读 342

Humor App

未分类


需求分析:

用户希望能够使用一款手机APP通过阅读英文幽默短文学习英文。用户可通过标题列表选择短文,可分别查看英文原文、中文译文和单词解释。

界面设计

1、主界面

2、作者介绍界面

3、幽默详情-英文

4、幽默详情-单词释义

5、幽默详情-中文译文

功能设计:

后台API

1、获取短文标题列表

请求方法:GET
请求地址:/api/humor/titles?count_per_page=x&page=y
请求参数:

count_per_page
分页请求的每页记录数。服务器端默认20。
page
分页请求的第几页。服务器端默认为1。

返回数据格式:

  1. {
  2. "doc_count": 10,
  3. "titles": [
  4. {
  5. "_id": "编号"
  6. "title": "English Title",
  7. "chinese": "中文标题"
  8. },
  9. ...
  10. ]
  11. }

其中:

doc_count
数据库中的短文数目,整型数。
titles
标题对象集合,数组。
_id
短文编号(唯一值),字符串。
title
短文英文标题,字符串。
chinese_title
短文中文标题,字符串。

2、获取幽默短文

请求方法:GET
请求地址:/api/humor/{humor_id}
地址参数:

humor_id
幽默短文的编号,字符串。

返回数据格式:

  1. {
  2. "_id": "短文编号",
  3. "title": "English Title",
  4. "chinese_title": "中文编号",
  5. "content": [
  6. "paragraph 1",
  7. "paragraph 2",
  8. ...
  9. ],
  10. "words":[
  11. "word 1",
  12. "word 2",
  13. ...
  14. ],
  15. "chinese": [
  16. "中文译文段落 1",
  17. "中文译文段落 2",
  18. ...
  19. ]
  20. }

其中:

_id
短文编号(唯一值),字符串。
title
短文英文标题,字符串。
chinese_title
短文中文标题,字符串。
content
英文段落集合,数组。
words
单词释义集合,数组。
chinese
中文译文段落集合,数组。
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注