jhunters / jprotobuf

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

java转.proto pojo的注释不会带到生成的.proto中 #209

Closed flyshulk closed 9 months ago

flyshulk commented 9 months ago

Java的pojo内容如示:

import com.baidu.bjf.remoting.protobuf.annotation.EnableZigZap;
import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;

//测试例子
@ProtobufClass
@EnableZigZap
public class PersonJProtoBufProtoClass {

    //姓名
    public String name;//姓名
    public Integer id;
    public String email;
    public Double doubleF;
    public Float floatF;
    public byte[] bytesF;
    public Boolean boolF;

}

生成的.proto文件内容如示:

syntax="proto3";
package protos.pb;
option java_outer_classname = "PersonJProtoBufProtoClass$$ByJProtobuf";
//
message PersonJProtoBufProtoClass {  
 string name=1;
 sint32 id=2;
 string email=3;
 double doubleF=4;
 float floatF=5;
 bytes bytesF=6;
 bool boolF=7;
}

可以看到生成的.proto文件中的注释丢失了。