提交 833b14a8 编写于 作者: 7 710leo

refactor

上级 32d0489a
......@@ -33,7 +33,7 @@ type ConfYaml struct {
}
type tplSection struct {
StraPath string `yaml:"straPath"`
AlertPath string `yaml:"alertPath"`
ScreenPath string `yaml:"screenPath"`
}
......@@ -182,7 +182,7 @@ func Parse(ymlfile string) error {
})
viper.SetDefault("tpl", map[string]string{
"straPath": "./etc/stra",
"alertPath": "./etc/alert",
"screenPath": "./etc/screen",
})
......
......@@ -13,8 +13,8 @@ func tplNameGets(c *gin.Context) {
var files []string
var err error
switch tplType {
case "stra":
files, err = file.FilesUnder(config.Get().Tpl.StraPath)
case "alert":
files, err = file.FilesUnder(config.Get().Tpl.AlertPath)
dangerous(err)
case "screen":
files, err = file.FilesUnder(config.Get().Tpl.ScreenPath)
......@@ -32,8 +32,8 @@ func tplGet(c *gin.Context) {
var filePath string
switch tplType {
case "stra":
filePath = config.Get().Tpl.StraPath + "/" + tplName
case "alert":
filePath = config.Get().Tpl.AlertPath + "/" + tplName
case "screen":
filePath = config.Get().Tpl.ScreenPath + "/" + tplName
default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册