intellj idea apidoc模板

setting -> Editor -> Live Template -> add template group -> add live template:

/**
 * api url配置在apidoc.json里
 * sampleUrl配置在apidoc.json里
 * @api {post} /v1/方法名 方法名
 * @apiGroup 项目名
 * @apiName 方法名
 * @apiVersion 1.0.0
 *
 * @apiDescription 接口描述
 *
 * @apiParam {String} param1  参数说明
 *
 * @apiSuccess {Number} status    状态码,1:有数据/成功,-1:没数据/失败
 * @apiSuccess {String} msg   提示信息
 * @apiSuccess {Object} data    返回数据
 *
 * @apiSuccessExample {json} Success-Response:
 * {"status":1,"msg":"成功","data":[]}
 *
 * @apiErrorExample {json} Error-Response:
 * {"status":-1,"msg":"没有数据"}
 * 
 * @apiSampleRequest /方法名
 */
public function $NAME$($PARAMETERS$){
    $END$
}

apidoc.json :

{
  "name": "xxxx接口文档",
  "version": "1.0.0",
  "description": "xxxx接口文档",
  "title": "xxxx接口文档",
  "url" : "https://www.xxx.com/xxx/api",
  "sampleUrl" : "https://www.xxx.com/xxx/api/v1"
}

命令行:

$  apidoc -i ./path/api/ -o ./apidoc

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值