Finish the prototype of Move method.
This commit is contained in:
@ -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文件。")
|
||||
|
Reference in New Issue
Block a user