1、设置方法注释
首先每个人都应该拥有写注释的规范,IDEA设置如下:
接口统一规范
_/** _ * * @author _mujiutian _ * @date $DATE$ $TIME$ * @param $params$ */
_2、_pom依赖添加插件
3、resources下配置json文件
smart-doc.json文件
{ "serverUrl": "http://127.0.0.1:8083", "isStrict": false, "allInOne": true, "outPath": "/Users/mac/Desktop", "coverOld": true, "packageFilters": "", "md5EncryptedHtmlName": false, "projectName": "雷达", "skipTransientField": true, "showAuthor":true, "requestFieldToUnderline":false, "responseFieldToUnderline":false, "inlineEnum":true, "recursionLimit":7, "revisionLogs": [ { "version": "1.0", "status": "create", "author": "mujiutian", "remarks": "smart测试使用接口文档" } ], "customResponseFields": [ { "name": "code", "desc": "响应代码", "value": "00000" } ], "rpcApiDependencies":[{ "artifactId":"SpringBoot2-Dubbo-Api", "groupId":"com.demo", "version":"1.0.0" }], "rpcConsumerConfig":"src/main/resources/consumer-example.conf", "apiObjectReplacements": [{ "className": "org.springframework.data.domain.Pageable", "replacementClassName": "com.power.doc.model.PageRequestDto" }], "apiConstants": [{ "constantsClassName": "com.power.doc.constants.RequestParamConstant" }], "sourceCodePaths": [ { "path": "src/main/java", "desc": "测试" } ] }
4、执行maven 插件
生成如下:
可立即提供给前端使用