From cf4b5cd63c19b749fc1f0ecc603a2ce13d78b609 Mon Sep 17 00:00:00 2001 From: yu_lang <534013339@qq.com> Date: Tue, 21 Sep 2021 09:44:22 +0800 Subject: [PATCH] feat(proto):add proto auto_tool --- protobuf/listx.proto | 1 - protobuf/storage.proto | 1 - shell/gen_protobuf.py | 4 +--- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/protobuf/listx.proto b/protobuf/listx.proto index 21effe8..85a6b5c 100644 --- a/protobuf/listx.proto +++ b/protobuf/listx.proto @@ -1,7 +1,6 @@ syntax = "proto3"; import "base.proto"; option go_package = "pkg/proto"; - message LSetRequest { BaseKey key = 1; } diff --git a/protobuf/storage.proto b/protobuf/storage.proto index afd9aa8..7a50c4d 100644 --- a/protobuf/storage.proto +++ b/protobuf/storage.proto @@ -8,7 +8,6 @@ message CommendResponse { } service CommServer { - rpc Set (SetRequest) returns (CommendResponse); rpc Get (GetRequest) returns (CommendResponse); rpc Add (AddRequest) returns (CommendResponse); diff --git a/shell/gen_protobuf.py b/shell/gen_protobuf.py index e09659a..9e7a02a 100644 --- a/shell/gen_protobuf.py +++ b/shell/gen_protobuf.py @@ -24,8 +24,6 @@ def load_conf(): key = to_camel(key).lower() cfg_camel[key] = [to_camel(v) for v in val] -# print(cfg_camel) - return cfg, cfg_camel @@ -73,7 +71,6 @@ def mkdir(cfg_camel): else: # 如果这个文件存在 with open(proto_path) as f: line = f.readlines() -# print(line) f.close() for v in value: function = v + 'Request' @@ -109,6 +106,7 @@ def mkdir(cfg_camel): file.write(l) file.close() + if __name__ == "__main__": conf, cfg_camel = load_conf() print(cfg_camel)