Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前后端接口API接口规范 #126

Open
mishe opened this issue Jun 8, 2016 · 0 comments
Open

前后端接口API接口规范 #126

mishe opened this issue Jun 8, 2016 · 0 comments

Comments

@mishe
Copy link
Owner

mishe commented Jun 8, 2016

Api地址: /api/vn/….
Vn:api版本,可以多版本的api共存,方便app端历史版本的兼容。
例如:/api/v1/product/1
/api/v2/product/1

传入参数:

  1. 地址栏
  2. 查询字串
  3. Cookie
  4. Header
    返回数据
    见返回数据模板;

接口返回模板:
{
status:0,
data:{},
msg:’’
}

Status: 接口的执行的状态
0表示成功
<0 表示有异常

0 表示接口有部分执行失败

Data 接口的主数据,可以根据实际返回数组或HASH

Msg 当status!=0 都应该有错误信息

具体api接口可以使用阿里的rap服务
Rap在线体验

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant