Finish the basic feature of Propfind.

This commit is contained in:
zicla
2019-04-21 02:50:17 +08:00
parent 466e406f74
commit 8461218d63
4 changed files with 72 additions and 13 deletions

View File

@ -140,16 +140,13 @@ func (this *DavService) Propstats(matter *Matter, propfind dav.Propfind) []dav.P
}
//处理 方法
func (this *DavService) HandlePropfind(writer http.ResponseWriter, request *http.Request, subPath string) {
func (this *DavService) HandlePropfind(writer http.ResponseWriter, request *http.Request, user *User, subPath string) {
fmt.Printf("列出文件/文件夹 %s\n", subPath)
//获取请求的层数。暂不支持 infinity
depth := this.ParseDepth(request)
//获取请求者
user := this.checkUser(writer, request)
//读取请求参数。按照用户的参数请求返回内容。
propfind, _, err := dav.ReadPropfind(request.Body)
this.PanicError(err)
@ -163,7 +160,6 @@ func (this *DavService) HandlePropfind(writer http.ResponseWriter, request *http
matter = this.matterDao.checkByUserUuidAndPath(user.Uuid, subPath)
}
var matters []*Matter
if depth == 0 {
matters = []*Matter{matter}