Add file filtering functionality

This commit is contained in:
2024-09-17 22:57:29 +07:00
parent 1a444bb6eb
commit 9323bdd07a
17 changed files with 185 additions and 133 deletions

View File

@ -8,6 +8,7 @@ import (
fileHandler "github.com/fossyy/filekeeper/handler/file"
deleteHandler "github.com/fossyy/filekeeper/handler/file/delete"
downloadHandler "github.com/fossyy/filekeeper/handler/file/download"
queryHandler "github.com/fossyy/filekeeper/handler/file/query"
renameFileHandler "github.com/fossyy/filekeeper/handler/file/rename"
uploadHandler "github.com/fossyy/filekeeper/handler/file/upload"
visibilityHandler "github.com/fossyy/filekeeper/handler/file/visibility"
@ -116,6 +117,10 @@ func SetupRoutes() *http.ServeMux {
middleware.Auth(fileHandler.GET, w, r)
})
handler.HandleFunc("GET /file/query", func(w http.ResponseWriter, r *http.Request) {
middleware.Auth(queryHandler.GET, w, r)
})
handler.HandleFunc("POST /file/{id}", func(w http.ResponseWriter, r *http.Request) {
middleware.Auth(uploadHandler.POST, w, r)
})