!43 修复 degen 错误问题

Merge pull request !43 from bandl/fix-structure-gen
This commit is contained in:
bandl 2021-10-04 01:22:38 +00:00 committed by Gitee
commit a556840f9b
3 changed files with 2 additions and 5 deletions

View File

@ -5,7 +5,7 @@ package structure
const ( const (
DEFAULT_KEY = iota DEFAULT_KEY = iota
{% for key in keys -%} {% for key in keys %}
{{key}} {{key}}
{%- endfor %} {%- endfor %}
) )

View File

@ -10,10 +10,6 @@ import (
"gitee.com/timedb/wheatCache/pkg/proto" "gitee.com/timedb/wheatCache/pkg/proto"
"gitee.com/timedb/wheatCache/pkg/structure" "gitee.com/timedb/wheatCache/pkg/structure"
{% for name in mod_name %}
"gitee.com/timedb/wheatCache/pkg/structure/{{name}}"
{% endfor %}
"time" "time"
) )

View File

@ -40,6 +40,7 @@ def mk_structure(cfg_camel):
file.write('syntax = "proto3";\nimport "base.proto";\noption go_package = "pkg/proto";\n') file.write('syntax = "proto3";\nimport "base.proto";\noption go_package = "pkg/proto";\n')
for v in value: for v in value:
file.write('\nmessage ' + v + 'Request ' + '{\n BaseKey key = 1;\n}\n') file.write('\nmessage ' + v + 'Request ' + '{\n BaseKey key = 1;\n}\n')
file.write('\nmessage ' + v + 'Response ' + '{\n int64 update_size = 1;\n}\n')
file.close() file.close()
else: # 如果这个文件存在 else: # 如果这个文件存在