apidoc操作
apidoc
首先要确认你的系统安装了nodejs
install apidoc
npm install -g apidoc
init apidoc.json
{ "name": "测试apidoc", "version": "1.0.0", "description": "接口测试", "title": "test apidoc", "url" : "http://localhost/test", "sampleUrl" : "http://localhost/test" }
init java ref:http://apidocjs.com/#params
/**- @apiDefine CentraServerGroup Centra-Server
*用户登录 注册 等
*/
- @apiDefine CentraServerGroup Centra-Server
/**
* @apiDefine UserParam
* @apiParam {Number} reqType .
* @apiParam {String} sign .
* @apiParam {String} password User password.
*/
/**
* @api {post} /user/signin User sign in
* @apiName signIn
* @apiGroup CentraServerGroup
* @apiUse UserParam
* @apiParamExample {json} Request-Example:
{
“osType”: 0,
“password”: “99”,
“userId”: “99@qq.com”
}
- @apiSuccess {String} firstname Firstname of the User.
- @apiSuccess {String} lastname Lastname of the User.
* - @apiSuccessExample Success-Response:
- HTTP/1.1 200 OK
- {
- “firstname”: “John”,
- “lastname”: “Doe”
- }
* - @apiErrorExample Error-Response:
{
“info”: {
“message”: “Something went wrong with your Signin”
},
“code”: 0
}
*/
5. execute
apidoc -i src/ -o apidoc/
[demo____________:)))address:][1]