jhunters / jprotobuf

A useful utility library for java programmer using google protobuf
Apache License 2.0
879 stars 281 forks source link

.proto转java pojo的时候建议增加注释的解析 #148

Open maocc opened 3 years ago

maocc commented 3 years ago

optional BrakePedalStatus brakePade = 1;//刹车踏板踩下情况 解析为

/**
     *刹车踏板踩下情况
     * optional BrakePedalStatus brakePade = 1;
     */
    @Protobuf(fieldType = FieldType.ENUM, order = 1, required = false)
    public BrakePedalStatus brakePade;

可以参考


<plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>0.5.1</version>
                <configuration>
                    <!--suppress UnresolvedMavenProperty -->
                    <protocArtifact>com.google.protobuf:protoc:3.13.0:exe:${os.detected.classifier}</protocArtifact>
                    <pluginId>grpc-java</pluginId>
                    <!--suppress UnresolvedMavenProperty -->
                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.14.0:exe:${os.detected.classifier}</pluginArtifact>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>compile-custom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
jhunters commented 3 years ago

2.4.5版本已经支持