以前用Spring的时候,使用的是SwaggerUI生成接口文档,不仅能随时更新反馈接口信息,同时提供接口测试功能,具体请参考https://swagger.io/swagger-ui/
然后使用JFinal的时候,发现官方没有提供集成方案,网上搜索有提供一个集成JDoc的,感觉界面和功能没有Swagger好,于是决定参考swagger-spring写JFinal集成SwaggerUI的插件
现在已经实现大体功能:
主要提供四个注解:

测试使用:
@ApiOperation(url = "/test", tag = "index", response = LogInfo.class, httpMethod = "get", description = "测试json")
@ApiParams({
@ApiParam(name = "id", description = "编号", required = true, dataType = "Long"),
@ApiParam(name = "name", description = "姓名", required = true, dataType = "String")
})
public void test() {
System.out.println(getPara("id") + " ======== " + getPara("name"));
LogUser user = new LogUser();
user.setId(1L);
renderJson(user);
}最终效果图:


代码地址:http://git.oschina.net/leeckent/jfinal-swagger
,开发工具是eclipse mars.2
,jfinal和jfinal-java8的版本是3.4, 设置为3.3也不行
检查了eclipse的所有设置都是1.8,选项也勾上了,
pom.xml里面也设置了compiler-plugin