Skip to content
Snippets Groups Projects
Commit bf930210 authored by Christian Pointner's avatar Christian Pointner
Browse files

some more refactoring

parent 63bce4d6
Branches
Tags
No related merge requests found
......@@ -68,37 +68,37 @@ func InstallHTTPHandler(r *gin.RouterGroup, st *store.Store, im *importer.Import
api := NewAPI(st, im, infoLog, errLog, dbgLog)
// Shows
r.GET("/shows", api.ListShows)
r.POST("/shows/:show-id", api.CreateShow)
// Files
r.GET("/shows/:show-id/files", api.ListFilesOfShow)
r.POST("/shows/:show-id/files", api.CreateFileForShow)
r.GET("/shows/:show-id/files/:file-id", api.ReadFileOfShow)
r.PATCH("/shows/:show-id/files/:file-id", api.PatchFileOfShow)
r.DELETE("/shows/:show-id/files/:file-id", api.DeleteFileOfShow)
r.GET("/shows/:show-id/files/:file-id/usage", api.ReadUsageOfFile)
r.GET("/shows/:show-id/files/:file-id/import", api.ReadImportOfFile)
r.DELETE("/shows/:show-id/files/:file-id/import", api.CancelImportOfFile)
// // TODO: distignuish between flow.js and simple upload using the content type?!?
r.PUT("/shows/:show-id/files/:file-id/upload", api.UploadFileSimple)
r.POST("/shows/:show-id/files/:file-id/upload", api.UploadFileFlowJS)
r.GET("/shows/:show-id/files/:file-id/upload", api.TestFileFlowJS)
// Imports
r.GET("/shows/:show-id/imports", api.ListImportsOfShow)
// Playlists
r.GET("/shows/:show-id/playlists", api.ListPlaylistsOfShow)
r.POST("/shows/:show-id/playlists", api.CreatePlaylistForShow)
r.GET("/shows/:show-id/playlists/:playlist-id", api.ReadPlaylistOfShow)
r.PUT("/shows/:show-id/playlists/:playlist-id", api.UpdatePlaylistOfShow)
r.DELETE("/shows/:show-id/playlists/:playlist-id", api.DeletePlaylistOfShow)
shows := r.Group("shows")
shows.GET("", api.ListShows)
shows.POST(":show-id", api.CreateShow)
shows.GET(":show-id/imports", api.ListImportsOfShow)
files := shows.Group(":show-id/files")
playlists := shows.Group(":show-id/playlists")
//
// Show/Files
files.GET("", api.ListFilesOfShow)
files.POST("", api.CreateFileForShow)
files.GET(":file-id", api.ReadFileOfShow)
files.PATCH(":file-id", api.PatchFileOfShow)
files.DELETE(":file-id", api.DeleteFileOfShow)
files.GET(":file-id/usage", api.ReadUsageOfFile)
files.GET(":file-id/import", api.ReadImportOfFile)
files.DELETE(":file-id/import", api.CancelImportOfFile)
// TODO: distignuish between flow.js and simple upload using the content type?!?
files.PUT(":file-id/upload", api.UploadFileSimple)
files.POST(":file-id/upload", api.UploadFileFlowJS)
files.GET(":file-id/upload", api.TestFileFlowJS)
//
// Show/Playlists
playlists.GET("", api.ListPlaylistsOfShow)
playlists.POST("", api.CreatePlaylistForShow)
playlists.GET(":playlist-id", api.ReadPlaylistOfShow)
playlists.PUT(":playlist-id", api.UpdatePlaylistOfShow)
playlists.DELETE(":playlist-id", api.DeletePlaylistOfShow)
// r.Handle("/", indexHandler)
}
......@@ -177,16 +177,16 @@ func InstallHTTPHandler(r *gin.RouterGroup) {
return
}
backends := r.Group("/backends")
backends := r.Group("backends")
backends.GET("", listBackends)
session := r.Group("/session")
session := r.Group("session")
session.POST("", newSession)
session.GET("", getSession)
session.DELETE("", deleteSession)
if auth.oidc != nil {
oidc := r.Group("/oidc")
oidc := r.Group("oidc")
oidc.GET("login", auth.oidc.Login)
oidc.GET("callback", auth.oidc.Callback)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment