Refine the directories.

This commit is contained in:
zicla
2019-04-26 02:30:04 +08:00
parent 61b14fe82b
commit b3c52ea50e
40 changed files with 214 additions and 162 deletions

View File

@ -4,7 +4,9 @@ import (
"github.com/jinzhu/gorm"
"github.com/nu7hatch/gouuid"
"os"
"tank/rest/config"
"tank/rest/result"
"tank/rest/tool"
"time"
)
@ -283,7 +285,7 @@ func (this *MatterDao) Delete(matter *Matter) {
this.PanicError(db.Error)
//从磁盘中删除该文件夹。
DeleteEmptyDir(matter.AbsolutePath())
tool.DeleteEmptyDir(matter.AbsolutePath())
} else {
@ -363,7 +365,7 @@ func (this *MatterDao) Cleanup() {
db := CONTEXT.DB.Where("uuid is not null").Delete(Matter{})
this.PanicError(db.Error)
err := os.RemoveAll(CONFIG.MatterPath)
err := os.RemoveAll(config.CONFIG.MatterPath)
this.PanicError(err)
}