提交 53733962 编写于 作者: V v_zhibsong

change filemove

上级 9a044b28
......@@ -12,10 +12,9 @@ import (
)
type tplData struct {
template *template.Template
locationPath string
autoCodePath string
autoMoveFilePath string
template *template.Template
locationPath string
autoCodePath string
}
// @title CreateTemp
......@@ -99,7 +98,7 @@ func CreateTemp(autoCode model.AutoCodeStruct) (err error) {
// 判断是否需要自动转移
for _, value := range dataList {
// 转移
err := utils.FileMove(value.locationPath, value.autoCodePath)
err := utils.FileMove(value.autoCodePath, utils.GetAutoPath(value.autoCodePath))
if err != nil {
return err
}
......
......@@ -59,3 +59,8 @@ func FileMove(src string, dst string) error {
}
return err
}
// GetAutoPath 根据生成路径生成移动路径
func GetAutoPath(path string) string {
return filepath.Base(filepath.Dir(path))
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册