Skip to content

JavaTool/grpc-http-api-generator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

grpc-http-api-generator

To generate http apis of gRPC service.

Generators:

  1. com.yinxiang.utils.api.doc.RestApiGenerator.
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>java</goal>
                </goals>
                <configuration>
                  <includePluginDependencies>true</includePluginDependencies>
                  <mainClass>com.yinxiang.utils.api.doc.RestApiGenerator</mainClass>
                  <arguments>
                    <argument>${basedir}/../test-stubs/target/generated-sources/protobuf/</argument>
                    <argument>${basedir}/../test-stubs/target/classes</argument>
                    <argument>${basedir}/</argument>
                    <argument></argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
    
  2. com.yinxiang.utils.api.doc.RestApiHtmlGenerator.
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>java</goal>
                </goals>
                <configuration>
                  <includePluginDependencies>true</includePluginDependencies>
                  <mainClass>com.yinxiang.utils.api.doc.RestApiHtmlGenerator</mainClass>
                  <arguments>
                    <argument>${basedir}/../test-stubs/target/generated-sources/protobuf/</argument>
                    <argument>${basedir}/../test-stubs/target/classes</argument>
                    <argument>${basedir}/</argument>
                    <argument></argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
    
  3. com.yinxiang.utils.api.doc.RestApiJsonGenerator.
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>java</goal>
                </goals>
                <configuration>
                  <includePluginDependencies>true</includePluginDependencies>
                  <mainClass>com.yinxiang.utils.api.doc.RestApiJsonGenerator</mainClass>
                  <arguments>
                    <argument>${basedir}/../test-stubs/target/generated-sources/protobuf/</argument>
                    <argument>${basedir}/../test-stubs/target/classes</argument>
                    <argument>${basedir}/</argument>
                    <argument></argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
    
  4. com.yinxiang.utils.api.doc.ServiceReactApiGenerator, need use: https://github.com/yinxiang-team/service-api-react. Clone it and create a new react project with copy all code and push to a git repository.
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>java</goal>
                </goals>
                <configuration>
                  <includePluginDependencies>true</includePluginDependencies>
                  <mainClass>com.yinxiang.utils.api.doc.ServiceReactApiGenerator</mainClass>
                  <arguments>
                    <argument>${basedir}/../test-stubs/target/generated-sources/protobuf/</argument>
                    <argument>${basedir}/../test-stubs/target/classes</argument>
                    <argument>${basedir}/_service-api</argument>
                    <argument></argument><!-- this arg is the new react repository. -->
                  </arguments>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>com.sun</groupId>
                <artifactId>tools</artifactId>
                <version>1.8</version>
                <scope>system</scope>
                <systemPath>${java.home}/../lib/tools.jar</systemPath>
              </dependency>
            </dependencies>
          </plugin>
    

About

To generate http apis of gRPC service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%