Fix: failed unit test / Feat: support TTL in redis cache

This commit is contained in:
HFO4
2019-12-13 13:22:10 +08:00
parent 8703f97e20
commit afc0b647ca
14 changed files with 78 additions and 369 deletions

View File

@@ -46,6 +46,12 @@ func (folder *Folder) GetChild(name string) (*Folder, error) {
func (folder *Folder) GetChildFolder() ([]Folder, error) {
var folders []Folder
result := DB.Where("parent_id = ?", folder.ID).Find(&folders)
if result.Error == nil {
for i := 0; i < len(folders); i++ {
folders[i].Position = path.Join(folder.Position, folder.Name)
}
}
return folders, result.Error
}