Finish the mirror feature. Finish the prototype of zip compress.
This commit is contained in:
@ -66,6 +66,9 @@ func (this *MatterController) RegisterRoutes() map[string]func(writer http.Respo
|
||||
routeMap["/api/matter/detail"] = this.Wrap(this.Detail, USER_ROLE_USER)
|
||||
routeMap["/api/matter/page"] = this.Wrap(this.Page, USER_ROLE_USER)
|
||||
|
||||
//本地文件映射
|
||||
routeMap["/api/matter/mirror"] = this.Wrap(this.Mirror, USER_ROLE_USER)
|
||||
|
||||
return routeMap
|
||||
}
|
||||
|
||||
@ -443,3 +446,27 @@ func (this *MatterController) Move(writer http.ResponseWriter, request *http.Req
|
||||
|
||||
return this.Success(nil)
|
||||
}
|
||||
|
||||
//将本地文件映射到蓝眼云盘中去。
|
||||
func (this *MatterController) Mirror(writer http.ResponseWriter, request *http.Request) *result.WebResult {
|
||||
|
||||
srcPath := request.FormValue("srcPath")
|
||||
destPath := request.FormValue("destPath")
|
||||
overwriteStr := request.FormValue("overwrite")
|
||||
|
||||
if srcPath == "" {
|
||||
panic(result.BadRequest("srcPath必填"))
|
||||
}
|
||||
|
||||
overwrite := false
|
||||
if overwriteStr == TRUE {
|
||||
overwrite = true
|
||||
}
|
||||
|
||||
user := this.userDao.checkUser(writer, request)
|
||||
|
||||
this.matterService.AtomicMirror(srcPath, destPath, overwrite, user)
|
||||
|
||||
return this.Success(nil)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user