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
|
|
@ -9,9 +9,10 @@ import (
|
|||
"arimelody-web/admin/templates"
|
||||
"arimelody-web/controller"
|
||||
"arimelody-web/model"
|
||||
"arimelody-web/model/app"
|
||||
)
|
||||
|
||||
func serveReleases(app *model.AppState) http.Handler {
|
||||
func serveReleases(app *app.AppState) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
session := r.Context().Value("session").(*model.Session)
|
||||
|
||||
|
|
@ -55,7 +56,7 @@ func serveReleases(app *model.AppState) http.Handler {
|
|||
})
|
||||
}
|
||||
|
||||
func serveRelease(app *model.AppState, releaseID string, action string) http.Handler {
|
||||
func serveRelease(app *app.AppState, releaseID string, action string) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
session := r.Context().Value("session").(*model.Session)
|
||||
|
||||
|
|
@ -127,7 +128,7 @@ func serveEditCredits(release *model.Release) http.Handler {
|
|||
})
|
||||
}
|
||||
|
||||
func serveAddCredit(app *model.AppState, release *model.Release) http.Handler {
|
||||
func serveAddCredit(app *app.AppState, release *model.Release) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
artists, err := controller.GetArtistsNotOnRelease(app.DB, release.ID)
|
||||
if err != nil {
|
||||
|
|
@ -153,7 +154,7 @@ func serveAddCredit(app *model.AppState, release *model.Release) http.Handler {
|
|||
})
|
||||
}
|
||||
|
||||
func serveNewCredit(app *model.AppState) http.Handler {
|
||||
func serveNewCredit(app *app.AppState) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
split := strings.Split(r.URL.Path, "/")
|
||||
artistID := split[len(split) - 1]
|
||||
|
|
@ -204,7 +205,7 @@ func serveEditTracks(release *model.Release) http.Handler {
|
|||
})
|
||||
}
|
||||
|
||||
func serveAddTrack(app *model.AppState, release *model.Release) http.Handler {
|
||||
func serveAddTrack(app *app.AppState, release *model.Release) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
tracks, err := controller.GetTracksNotOnRelease(app.DB, release.ID)
|
||||
if err != nil {
|
||||
|
|
@ -230,7 +231,7 @@ func serveAddTrack(app *model.AppState, release *model.Release) http.Handler {
|
|||
})
|
||||
}
|
||||
|
||||
func serveNewTrack(app *model.AppState) http.Handler {
|
||||
func serveNewTrack(app *app.AppState) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
split := strings.Split(r.URL.Path, "/")
|
||||
trackID := split[len(split) - 1]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue