8

.proto メッセージを作成し、次のような REST サービスを公開しています

@Path("/test")
public interface test{

@POST
@Produces("application/x-protobuf")
@Consumes("application/x-protobuf")
public Response getProperties(TestRequest testrq);
}

TestRequest は Java で生成された .protobuf のファイルであり、リクエスト本文に渡すにはどうすればよいですか?

これは .proto ファイル形式になります

message TestRequest
{
    string id = 1;
    string name = 2;
    enum TestType
    {
        Test=1
    }
   TestType testType = 3; 
}
4

2 に答える 2