Skip to content

Instantly share code, notes, and snippets.

@liuchang0812
Last active December 18, 2015 13:29
Show Gist options
  • Save liuchang0812/5790551 to your computer and use it in GitHub Desktop.
Save liuchang0812/5790551 to your computer and use it in GitHub Desktop.
api define
host url: http://3.lcusersystem.sinaapp.com/
@liuchang0812
Copy link
Author

注册用户

url: /reguser
method: post
forms:
username : 用户名
passwd : 密码
email : 电子邮箱
response:
一个json , 有字段result 。 1表示注册成功,0表示注册失败 ( 以下同 )
例如:

{
  "result": "1"
}

@liuchang0812
Copy link
Author

查询用户

url: /getuser
method: post
forms:
userid
response:
一个json , 有字段result 。 1表示注册成功,0表示注册失败 ,字段username , email , passwd
例如:

{
  "passwd": "123456", 
  "username": "lc", 
  "userid": 1, 
  "result": "1", 
  "email": "lc@gmail.com"
}

@liuchang0812
Copy link
Author

修改用户信息

请求地址: /moduser
请求方法: POST
表单信息:
userid , username , email , passwd
返回内容:
一个json , 一个result字段。

{
  "result": "1"
}

@liuchang0812
Copy link
Author

取得提问列表

地址:/getrequestlist
返回:
json , 一个列表 , 每个内容包含 questionid,userid,category(所属类目),questioncontent(提问内容),questiondate(提问时间),answercontent(回答内容),answeruser(回复人),answerdate(回复时间)
例如:

{
[{'category': u'listen', 'questionId': 2, '_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x025975F0>, 'answerUser': None, 'answerContent': None, 'userId': 1, 'answerDate': None, 'questionDate': datetime.datetime(2013, 6, 16, 2, 4, 31, 860000), 'questionContent': u'how to learn ?'}, {'category': u'listen', 'questionId': 1, '_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x02597670>, 'answerUser': None, 'answerContent': None, 'userId': 1, 'answerDate': None, 'questionDate': datetime.datetime(2013, 6, 16, 2, 4, 20, 113000), 'questionContent': u'how to learn english?'}]
} 

@liuchang0812
Copy link
Author

添加一条提问

地址: /subrequest
方法:POST
表单内容:
userid , category , questcontent
返回内容:

{
  "result": "1"
}

@liuchang0812
Copy link
Author

添加一条分享

地址 : /addshare
方法 : POST
表单内容:
userid , content , title
返回内容:
json
例如:

成功

{
  "result": "1"
}

失败

{
 "result":“0”
}

@liuchang0812
Copy link
Author

一键注册

地址: /regone
返回内容:
result , userid

注册一个名为: zhixing , 密码为123456 , 邮箱为zhixing@qq.com的用户

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment