From e9ca38a07872475a8e32691596731fce5b02192a Mon Sep 17 00:00:00 2001 From: Nex Date: Fri, 7 Sep 2018 12:53:15 +0800 Subject: [PATCH] Update proto files and scripts --- ac_chain.proto => bg/api/ac_chain.proto | 9 +++++++-- common.proto => bg/api/common.proto | 7 ++++++- tx_ledger.proto => bg/api/tx_ledger.proto | 9 +++++++-- gen.bat | 4 +++- gen.sh | 4 +++- 5 files changed, 26 insertions(+), 7 deletions(-) rename ac_chain.proto => bg/api/ac_chain.proto (93%) rename common.proto => bg/api/common.proto (52%) rename tx_ledger.proto => bg/api/tx_ledger.proto (76%) diff --git a/ac_chain.proto b/bg/api/ac_chain.proto similarity index 93% rename from ac_chain.proto rename to bg/api/ac_chain.proto index 8719316..ad8271c 100644 --- a/ac_chain.proto +++ b/bg/api/ac_chain.proto @@ -1,8 +1,13 @@ syntax = "proto3"; -package api; +package bg.api; -import "common.proto"; +import "bg/api/common.proto"; + +option go_package = "bg/api/protobuf/ac_chain"; +option java_package = "bg.protobuf"; +option java_outer_classname = "AcChainProto"; +option java_multiple_files = true; service AcChain { rpc BlockNumber (BlockNumberRequest) returns (BlockNumberResponse); diff --git a/common.proto b/bg/api/common.proto similarity index 52% rename from common.proto rename to bg/api/common.proto index c2424ef..efdb38e 100644 --- a/common.proto +++ b/bg/api/common.proto @@ -1,6 +1,11 @@ syntax = "proto3"; -package api; +package bg.api; + +option go_package = "bg/api/protobuf/common"; +option java_package = "bg.protobuf"; +option java_outer_classname = "CommonProto"; +option java_multiple_files = true; enum MessageType { RECORD = 0; // 通用数据记录 diff --git a/tx_ledger.proto b/bg/api/tx_ledger.proto similarity index 76% rename from tx_ledger.proto rename to bg/api/tx_ledger.proto index ad9fb35..53a7790 100644 --- a/tx_ledger.proto +++ b/bg/api/tx_ledger.proto @@ -1,8 +1,13 @@ syntax = "proto3"; -package api; +package bg.api; -import "common.proto"; +import "bg/api/common.proto"; + +option go_package = "bg/api/protobuf/tx_ledger"; +option java_package = "bg.protobuf"; +option java_outer_classname = "TxLedgerProto"; +option java_multiple_files = true; service TxLedger { rpc CreateLedger (CreateLedgerRequest) returns (CreateLedgerResponse); diff --git a/gen.bat b/gen.bat index 5155e5a..dec8950 100644 --- a/gen.bat +++ b/gen.bat @@ -1,2 +1,4 @@ mkdir go -protoc -I=. --go_out=plugins=grpc:go common.proto tx_ledger.proto ac_chain.proto +protoc -I . --go_out=plugins=grpc:go bg/api/common.proto +protoc -I . --go_out=plugins=grpc:go bg/api/tx_ledger.proto +protoc -I . --go_out=plugins=grpc:go bg/api/ac_chain.proto diff --git a/gen.sh b/gen.sh index 5155e5a..dec8950 100644 --- a/gen.sh +++ b/gen.sh @@ -1,2 +1,4 @@ mkdir go -protoc -I=. --go_out=plugins=grpc:go common.proto tx_ledger.proto ac_chain.proto +protoc -I . --go_out=plugins=grpc:go bg/api/common.proto +protoc -I . --go_out=plugins=grpc:go bg/api/tx_ledger.proto +protoc -I . --go_out=plugins=grpc:go bg/api/ac_chain.proto