Finish the prototype of Move method.

This commit is contained in:
zicla
2019-04-22 21:32:49 +08:00
parent 437306c064
commit 99710eb670
4 changed files with 165 additions and 42 deletions

View File

@ -284,7 +284,7 @@ func (this *MatterDao) SizeBetweenTime(startTime time.Time, endTime time.Time) i
}
//根据userUuid和path来查找
func (this *MatterDao) checkByUserUuidAndPath(userUuid string, path string) *Matter {
func (this *MatterDao) findByUserUuidAndPath(userUuid string, path string) *Matter {
var wp = &WherePair{Query: "user_uuid = ? AND path = ?", Args: []interface{}{userUuid, path}}
@ -293,7 +293,7 @@ func (this *MatterDao) checkByUserUuidAndPath(userUuid string, path string) *Mat
if db.Error != nil {
if db.Error.Error() == DB_ERROR_NOT_FOUND {
this.PanicNotFound("%s 不存在", path)
return nil
} else {
this.PanicError(db.Error)
}
@ -302,6 +302,17 @@ func (this *MatterDao) checkByUserUuidAndPath(userUuid string, path string) *Mat
return matter
}
//根据userUuid和path来查找
func (this *MatterDao) checkByUserUuidAndPath(userUuid string, path string) *Matter {
matter := this.findByUserUuidAndPath(userUuid,path)
if matter == nil {
this.PanicNotFound("%s 不存在", path)
}
return matter
}
//执行清理操作
func (this *MatterDao) Cleanup() {
this.logger.Info("[MatterDao]执行清理清除数据库中所有Matter记录。删除磁盘中所有Matter文件。")