接口说明文档书写格式

来源:互联网 发布:深圳周末编程培训 编辑:程序博客网 时间:2024/05/14 04:33

1、根据企业唯一标识查找该企业下属企业信息:

方法:GET

接口url:rest-spring/kc/seldept/{企业唯一标识}.do

输出参数:

参数

参数名称

参数类型

备注

orgid

企业唯一标识

String

初始值 150

orgname

企业全称

String

 

f_industry_shortname

企业简称

String

 

示例:http://localhost:8080/rest-spring/kc/seldept/150625.do

返回:

[    {        "orgid":"150625",        "orgname": " 旗",       "f_industry_shortname": " 旗"    },    {        "orgid":"26bcc2ae-5c45-48b3-867f-15acf3c08099",        "orgname": "  能源公司煤矿",       "f_industry_shortname": "煤矿"    }]


2、添加用户:

方法:POST

接口url:rest-spring/kc/add.do

输入参数:JSON格式

 params:{    "groupid": groupid,    "username": username,    "loginid": loginid,    "password": password,    "email": email,    "telephone":telephone,    "mobilephone":mobilephone};


参数

参数名称

参数类型

备注

groupid

企业唯一标识

String

必填,参见第一条查询结果orgid

username

用户名

String

 

loginid

登录名

String

必填

password

密码

String

必填

email

邮箱

String

 

telephone

电话

String

 

mobilephone

手机

String

 

示例:

//传入添加的企业,登录名,密码,以及其他参数

var data = {    "groupid": ”150627”,    "username": ”zhang”,    "loginid": ”_mkmtj0j”,    "password": ”1”,    "email": ”1@qq.com”,    "telephone":”1234567”,    "mobilephone":”13512345678”};    $.ajax({        type: 'POST',        url: ' http://localhost:8080/rest-spring/kc/add.do',        data: JSON.stringify(data),        dataType:'json',        contentType:"application/json;charset=utf-8",        success:function(datas){         //返回值中message参数为返回信息        alert(datas.message);        }          });


输出参数:JSON格式message 提示信息  包含:添加成功 | 存在相同登陆id