Skip to content

kofei/-Redis-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

使用Redis搭建微博网站

###接口设计

####一.以GET加参数的方式访问服务器,打捞一个漂流瓶,返回JSON数据:

GET /?user = xxx [type=xxx]
// SUCCESS return
// {"code: 1, msg: {"time": "...", "owner": "...", "type": "...", "content": "..."}}
// ERROR return {"code": 0, "msg": "..."}

#####(1).GET参数

  • user:捡漂流瓶的人的用户名或ID,必须唯一。
  • type:漂流瓶类型,分三类:all, male, female。

#####(2).返回的JSON参数

  • code:标识码,1表示成功,0表示失败。
  • mag:返回的信息。
  • time:漂流瓶扔出的时间戳。
  • owner:漂流瓶主人,用户名或ID任意一个。
  • type:类型,male或female。
  • content:内容。

####二.以POST请求服务器,扔出一个漂流瓶,返回JSON数据:

POST owner = xxx & type=xxx & content=xxx [&time=xxx]
// SUCCESS return {"code": 1, "msg": "..."}
// ERROR return {"code": 0, "msg": "..."}

About

练习,熟悉例程。来自《Node.js实战》

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published