log in
Interface Description
User Interface login
interface address
Request parameter
username |
username |
String |
Yes |
password |
password |
String |
Yes |
return value
{'status': 1, 'message': 'login success'}
{'status': 0, 'message': 'username or password null'}
{'status': 0, 'message': 'username or password error'}
{'status': 0, 'message': 'request type error'}
Create a blog
Interface Description
Create a blog Interface
interface address
Request parameter
id |
Blog id |
Int |
no |
title |
Blog title |
String |
Yes |
10 |
author |
Blog author |
String |
Yes |
10 |
content |
Blog content |
String |
Yes |
500 |
return value
{'status': 0, 'message': 'id or title or author or content null'}
{'status': 0, 'message': "参数类型错误"}
{'status': 0, 'message': 'article id already exists'}
{'status': 0, 'message': "创建博客失败"}
{'status': 1, 'data': data, 'message': 'add article success'}
{'status': 0, 'message': 'request type error'}
Modify blog
Interface Description
User interface to modify the blog
interface address
Request parameter
id |
Blog id |
Int |
Yes |
title |
Blog title |
String |
Yes |
10 |
author |
Blog author |
String |
Yes |
10 |
content |
Blog content |
String |
Yes |
500 |
return value
{'status': 0, 'message': 'id or title or author or content null'}
{'status': 0, 'message': "参数类型错误"}
{'status': 0, 'message': 'article not exist'}
{'status': 0, 'message': "修改博客失败"}
{'status': 1, 'data': data, 'message': 'modify article success'}
{'status': 0, 'message': 'request type error'}
Queries blog
Interface Description
Interface according to user queries blog title
interface address
Request parameter
title |
Blog title |
String |
no |
return value
{'status': 1, 'message': 'login success'}
{'status': 0, 'message': 'username or password null'}
{'status': 0, 'message': 'username or password error'}
{'status': 0, 'message': 'request type error'}
Delete blog
Interface Description
User interface to delete the blog
interface address
Request parameter
return value
{'status': 0, 'message': 'id null'}
{'status': 0, 'message': "参数类型错误"}
{'status': 0, 'message': 'id not exist'}
{'status': 0, 'message': '删除博客失败'}
{'status': 1, 'message': 'delete article success'}
{'status': 0, 'message': 'request type error'}
As already mentioned before, we test interface, the general is CRUD and login is five, so here is simple to write a demo, covering five or more.