- def isWindows() {
- return org.gradle.internal.os.OperatingSystem.current().isWindows()
- }
- String apidocCmd = isWindows() ? 'apidoc.cmd' : 'apidoc'
- task apidocs(type: Exec, description: '执行生成apidoc文档操作') {
- workingDir './'
- def docCommand = [apidocCmd, '-o', './build/apidocs']
- commandLine docCommand
- }
- {
- "name": "springboot-sample接口文档",
- "version": "1.0.0",
- "description": "",
- "title": "springboot-sample",
- "url" : "https://demo.test.com"
- }
- /**
- * @apiVersion 1.0.0
- * @api {GET} /group/front/getOutlinePaySuccessInfo 获取支付成功数据
- * @apiGroup TransferAccount
- * @apiName getOutlinePaySuccessInfo
- * @apiParam (请求参数) {String} orderID 订单号
- * @apiParam (请求参数) {String} partnerCode 渠道code
- * @apiParam (请求参数) {String} sign 签名
- * @apiParamExample 请求参数示例
- * ?orderID=G0000168752925895356416&partnerCode=wyxx&sign=064d8cc51ed0957839e62f6684a4fe5c
- * @apiSuccess (响应参数) {String} accountName 收款人
- * @apiSuccess (响应参数) {Number} insuredNum 被保人数量
- * @apiSuccess (响应参数) {String} returnUrl 跳转地址(可能为空)
- * @apiSuccess (响应参数) {Number} validStartDate 开始时间
- * @apiSuccess (响应参数) {Number} validEndDate 截止时间
- * @apiSuccessExample 响应示例
- * {"code":200,"msg":"成功","data":{"groupName":"微易测试","insuredNum":5,"returnUrl":"http://www.baidu.com","validStartDate":1524127875000,"validEndDate":1524127875000}}
- */
- /**
- * @apiVersion 1.0.0
- * @api {method$END$} path title
- * @apiGroup name
- * @apiName name
- *
- * @apiParam (请求参数) {type} field description
- * @apiParam (请求参数) {type} field=defaultValue description
- * @apiParamExample 请求参数示例
- * example
- *
- * @apiParam (请求体) {type} field description
- * @apiParam (请求体) {type} field=defaultValue description
- * @apiParamExample 请求体示例
- * example
- *
- * @apiSuccess (响应参数) {type} field description
- * @apiSuccess (响应参数) {type} field description
- * @apiSuccessExample 响应示例
- * example
- *
- */
文章出自:http://blog.suiyiwen.com/post/4
文章来源: API接口文档生成方案调研