fix(middleware):add middleware format

This commit is contained in:
Sodesnei 2021-09-29 20:24:51 +08:00
parent 488d84580e
commit 2c6a6a6848
3 changed files with 12 additions and 11 deletions

View File

@ -1,5 +0,0 @@
package log_middle
func wait() {
}

View File

@ -1,7 +1,7 @@
package middle
import middleConf "gitee.com/timedb/wheatCache/middleware/config"
import getMiddlewareMap "gitee.com/timedb/wheatCache/middleware/config"
func init() {
middleConf.GetMiddlewareMap()
func Init() {
getMiddlewareMap.GetMiddlewareMap()
}

View File

@ -51,17 +51,23 @@ def getMiddleDir(keys:list)->list:
dirs.append(middleware)
return dirs
def format_code_go():
go_fmt(f"{middlePath}/config/middle.gen.go")
if __name__ == "__main__":
def set_middle_server():
tem_text = load_template("middle.template")
temp = Template(tem_text)
keys = getMiddleName(middlePath)
dirs = getMiddleDir(keys)
text = temp.render(dirs=dirs,)
text = temp.render(dirs=dirs)
temp_path = f"{middlePath}/config/middle.gen.go"
with open(temp_path,'w',encoding='utf-8') as f:
f.write(text)
if __name__ == "__main__":
set_middle_server()
format_code_go()