forked from p93542168/wheat-cache
fix(middleware):add middleware format
This commit is contained in:
parent
488d84580e
commit
2c6a6a6848
|
@ -1,5 +0,0 @@
|
||||||
package log_middle
|
|
||||||
|
|
||||||
func wait() {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
package middle
|
package middle
|
||||||
|
|
||||||
import middleConf "gitee.com/timedb/wheatCache/middleware/config"
|
import getMiddlewareMap "gitee.com/timedb/wheatCache/middleware/config"
|
||||||
|
|
||||||
func init() {
|
func Init() {
|
||||||
middleConf.GetMiddlewareMap()
|
getMiddlewareMap.GetMiddlewareMap()
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,17 +51,23 @@ def getMiddleDir(keys:list)->list:
|
||||||
dirs.append(middleware)
|
dirs.append(middleware)
|
||||||
return dirs
|
return dirs
|
||||||
|
|
||||||
|
def format_code_go():
|
||||||
|
go_fmt(f"{middlePath}/config/middle.gen.go")
|
||||||
|
|
||||||
|
def set_middle_server():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
|
|
||||||
tem_text = load_template("middle.template")
|
tem_text = load_template("middle.template")
|
||||||
temp = Template(tem_text)
|
temp = Template(tem_text)
|
||||||
keys = getMiddleName(middlePath)
|
keys = getMiddleName(middlePath)
|
||||||
dirs = getMiddleDir(keys)
|
dirs = getMiddleDir(keys)
|
||||||
text = temp.render(dirs=dirs,)
|
text = temp.render(dirs=dirs)
|
||||||
temp_path = f"{middlePath}/config/middle.gen.go"
|
temp_path = f"{middlePath}/config/middle.gen.go"
|
||||||
with open(temp_path,'w',encoding='utf-8') as f:
|
with open(temp_path,'w',encoding='utf-8') as f:
|
||||||
f.write(text)
|
f.write(text)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
set_middle_server()
|
||||||
|
format_code_go()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue