Protoc-gen-java-curd 是一款java 模板代码生成工具,基于protobuf 插件开发的
下载代码 git clone https://github.com/feihua/protoc-gen-java-curd.git
cd protoc-gen-java-curd目录
go install 编译安装
https://github.com/feihua/protoc-gen-java-curd/releases/download/v0.1.0/protoc-gen-java-curd.rar
syntax = "proto3";
package com.example.springboottpl.test;
option go_package = "./protoc_struct";
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
// Sends a greeting
rpc DeleteHello (HelloRequest) returns (HelloReply) {}
// Sends a greeting
rpc SaveHello (HelloRequest) returns (HelloReply) {}
// Sends a greeting
rpc UpdateHello (HelloRequest) returns (HelloReply) {}
// Sends another greeting
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
}
// The greeting service definition test.
service GreeterTest {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
// Sends another greeting
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
}
// The request message containing the user's name.
message HelloRequest {
string name = 1;// 名称
}
// The response message containing the greetings
message HelloReply {
string message = 1;// 名称
int64 age = 2;// 年龄
}
protoc --java-curd_out=./ ./hello.proto