Fix the rename image cache unavailable bug.
This commit is contained in:
parent
4331fc2661
commit
2d650aca2f
@ -14,6 +14,7 @@ type MatterController struct {
|
||||
matterDao *MatterDao
|
||||
matterService *MatterService
|
||||
downloadTokenDao *DownloadTokenDao
|
||||
imageCacheDao *ImageCacheDao
|
||||
}
|
||||
|
||||
//初始化方法
|
||||
@ -36,6 +37,11 @@ func (this *MatterController) Init() {
|
||||
this.downloadTokenDao = b
|
||||
}
|
||||
|
||||
b = CONTEXT.GetBean(this.imageCacheDao)
|
||||
if b, ok := b.(*ImageCacheDao); ok {
|
||||
this.imageCacheDao = b
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//注册自己的路由。
|
||||
@ -430,6 +436,11 @@ func (this *MatterController) Rename(writer http.ResponseWriter, request *http.R
|
||||
matter.Name = name
|
||||
matter = this.matterDao.Save(matter)
|
||||
|
||||
//删除对应的缓存图片。
|
||||
if !matter.Dir {
|
||||
this.imageCacheDao.DeleteByMatterUuid(matter.Uuid)
|
||||
}
|
||||
|
||||
return this.Success(matter)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user