HEAVY: migrate accounts and logs to service/repo architecture
This commit is contained in:
parent
5c255fb34b
commit
49e14b5bc5
37 changed files with 1019 additions and 687 deletions
|
|
@ -1,18 +1,19 @@
|
|||
package view
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"arimelody-web/controller"
|
||||
"arimelody-web/model"
|
||||
"arimelody-web/templates"
|
||||
"arimelody-web/controller"
|
||||
"arimelody-web/model"
|
||||
"arimelody-web/model/app"
|
||||
"arimelody-web/templates"
|
||||
)
|
||||
|
||||
// HTTP HANDLER METHODS
|
||||
|
||||
func MusicHandler(app *model.AppState) http.Handler {
|
||||
func MusicHandler(app *app.AppState) http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
|
||||
mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
@ -33,7 +34,7 @@ func MusicHandler(app *model.AppState) http.Handler {
|
|||
return mux
|
||||
}
|
||||
|
||||
func ServeCatalog(app *model.AppState) http.Handler {
|
||||
func ServeCatalog(app *app.AppState) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
releases, err := controller.GetAllReleases(app.DB, true, 0, true)
|
||||
if err != nil {
|
||||
|
|
@ -55,7 +56,7 @@ func ServeCatalog(app *model.AppState) http.Handler {
|
|||
})
|
||||
}
|
||||
|
||||
func ServeGateway(app *model.AppState, release *model.Release) http.Handler {
|
||||
func ServeGateway(app *app.AppState, release *model.Release) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// only allow authorised users to view hidden releases
|
||||
privileged := false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue