一、简介
- smart-doc介绍
- 创建md、html等格式的接口文档 - showdoc-在线API文档、技术文档工具
- 保存、预览接口文档,开源,可以自己部署服务
- 支持手动创建 和 上传。
二、smart-doc 使用注意事项、总结
基础使用,看官方文档
1、可以通过 packageFilters 参数,设置需要生成文档的包
config.setPackageFilters("com.power.doc.controller");
2、@ignore 注解,忽略某个接口,不生成文档
/**
* 煤矿日报详情
* @param reportSubmitId
* @ignore
*/
@ApiOperation(value = "煤矿日报详情")
@GetMapping(value = "/mineDayReportInfo")
3、@ignore注解,忽略某个属性,不生成文档
/**
* 公司id
* @ignore
*/
private String companyId ;
4、@ignore 注解 只能用于注释里面,接口则接口被忽略,
5、@ignore 用于某个类中的属性值注释的时候
① 这个类作为入参时,这个类中使用@ignore的属性被忽略,不生成入参文档
@这个类作为返回值,@ignore不起作用
6、不支持自定义某个controller 被忽略。
7、如下入参 ,默认生成文档 :必填=true ,需要设置不是必填,或者忽略,需要创建为对象。
public InterceptorResult getMonthReportList(String companyType, String dateStr) {
List<ReportListVO> result = service.getMonthReportList(companyType, dateStr);
return InterceptorResult.success(result);
}
8、包含属性的类作为入参,里面所有属性默认:必填= false
可以通过@required 设置为必填,