In doing the project, if the project is before and after separation, be sure to back-end and front end or the mobile docking interface, so the question is, the interface is not addressed to their own look, the general will use Excel or Word to write , senior point on the use of API management platform manual entry, a project with thousands of tens of thousands of interfaces, God, this is such a big workload, even more painful when the interface maintenance, in order to solve such a thing we can use japi the project to complete RESTFul document automatically generated, based entirely on comments generated, you can view more detailed configuration https://github.com/dounine/japi .
Instructions for use
Clone projects down
git clone https://github.com/dounine/japi.git
Compiler package
cd japi/java
gradle install -xtest
Run JAPI Admin
cd japi/java
gradle bootRun
Run JAPI Document Interface
cd japi/node
node app.js
RESTFul document generation
maven project
<dependency>
<groupId>com.dounine.japi</groupId>
<artifactId>client</artifactId>
<version>1.0</version>
</dependency>
gradle project
compile group: 'com.dounine.japi', name: 'client', version: '1.0'
Edit resources/japi.properties
Profile
japi.name=test
japi.uuid=43a600877430438596de3d330e4bd06e
japi.version=1.0.0
japi.author=lake
japi.url=http://192.168.0.123:8080
japi.description=this is project description.
japi.createTime=2017-02-23 10:44:44
japi.icon=/home/lake/github/japi/html/img/logo.png
japi.server=http://192.168.0.179:7778
japi.server.username=japi
japi.server.password=japi123
Writing an action
/**
* 获取用户列表
* @param user 用户信息
* @return class User
* @version v2
*/
@GetMapping(value = "v2/list")
public Result hots(@Validated({User.UserDEL.class}) User user) throws RuntimeException {
return null;
}
Write a generation API class
JapiCreateTest.java
@Test
public void testCreate(){
JapiClient.setPrefixPath("/home/lake/github/test-japi/java/");//项目路径前缀
JapiClient.setpostfixPath("/src/main/java");//项目路径后缀
JapiClient.setProjectJavaPath("client");//主项目地扯
JapiClient.setActionReletivePath("com/dounine/test-japi/action");//相对主项目action包所在路径
//JapiClient.setIncludeProjectJavaPath(new String[]{"api"});//主项目中关联的其它项目包路径
JapiClient.setIncludePackages(new String[]{"com.dounine.test-japi"});//关联的包,用于准确快速搜索
JapiClient.saveHistory(true);//是否保留本地历史版本
JapiClient.setFlushServer(false);//强制同步本地与服务器所有的版本(会先删除服务器以前的历史版本)
IProject project = ProjectImpl.init();
JapiClientStorage japiClientStorage = JapiClientStorage.getInstance();
japiClientStorage.setProject(project);
japiClientStorage.autoSaveToDisk();//自动使用到本地磁盘==> 用户目录/.japi-client/
new JapiClientTransfer().autoTransfer(japiClientStorage);//文件传输到主服务器.
}
Last Visitors browser http: // localhost: 7777
You can see the document Login RESTFul
Use your account to log in, you can see all the items
Look into the project in detail RESTFul Interface
scenes to be used
JAPI
The most suitable SpringCloud
use of such a distributed multi-module project, built a powerful regular expression, it makes code comments more standardized, different from swigger
such use 侵入式
annotated document generation, JAPI
is based entirely on standard 注释
generated strong support JSR303
or custom annotation.
Spirit of open source
Welcomed the intention of the students joined JAPI
the project team will transform it better.