Add the MatterLock strategy.

This commit is contained in:
zicla
2019-04-24 20:48:59 +08:00
parent daa5847859
commit d0fb55318f
5 changed files with 99 additions and 63 deletions

View File

@ -282,15 +282,15 @@ func (this *DavService) HandleMkcol(writer http.ResponseWriter, request *http.Re
dirPath := GetDirOfPath(subPath)
//寻找符合条件的matter.
var matter *Matter
var dirMatter *Matter
//如果是空或者/就是请求根目录
if dirPath == "" || dirPath == "/" {
matter = NewRootMatter(user)
dirMatter = NewRootMatter(user)
} else {
matter = this.matterDao.checkByUserUuidAndPath(user.Uuid, dirPath)
dirMatter = this.matterDao.checkByUserUuidAndPath(user.Uuid, dirPath)
}
this.matterService.CreateDirectory(matter.Uuid, thisDirName, user)
this.matterService.CreateDirectory(dirMatter, thisDirName, user)
}