feat(shell): update proto

This commit is contained in:
bandl 2021-10-05 16:39:00 +08:00
parent 26226eca28
commit 74ab13c756
2 changed files with 2 additions and 8 deletions

View File

@ -8,7 +8,6 @@ message SetRequest {
}
message SetResponse {
int64 update_size = 1;
string result = 2;
}
@ -17,7 +16,6 @@ message GetRequest {
}
message GetResponse {
int64 update_size = 1;
string result = 2;
}
@ -27,7 +25,6 @@ message AddRequest {
}
message AddResponse {
int64 update_size = 1;
string result = 2;
}
@ -37,7 +34,6 @@ message ReduceRequest {
}
message ReduceResponse {
int64 update_size = 1;
string result = 2;
}
@ -48,7 +44,6 @@ message SetbitRequest {
}
message SetbitResponse {
int64 update_size = 1;
}
message GetbitRequest {
@ -57,6 +52,5 @@ message GetbitRequest {
}
message GetbitResponse {
int64 update_size = 1;
bool val = 2;
}

View File

@ -40,7 +40,7 @@ def mk_structure(cfg_camel):
file.write('syntax = "proto3";\nimport "base.proto";\noption go_package = "pkg/proto";\n')
for v in value:
file.write('\nmessage ' + v + 'Request ' + '{\n BaseKey key = 1;\n}\n')
file.write('\nmessage ' + v + 'Response ' + '{\n int64 update_size = 1;\n}\n')
file.write('\nmessage ' + v + 'Response ' + '{\n}\n')
file.close()
else: # 如果这个文件存在
@ -58,7 +58,7 @@ def mk_structure(cfg_camel):
if flag == 0:
file = open(proto_path, 'a')
file.write('\nmessage ' + v + 'Request ' + '{\n BaseKey key = 1;\n}\n')
file.write("\nmessage %sResponse {\n int64 update_size = 1;\n}\n" % v)
file.write("\nmessage %sResponse {\n}\n" % v)
file.close()
print(f"{key}.proto", "-> success")