HEAVY: migrate accounts and logs to service/repo architecture

This commit is contained in:
ari melody 2026-07-31 02:43:45 +01:00
parent 5c255fb34b
commit 49e14b5bc5
Signed by: ari
GPG key ID: CF99829C92678188
37 changed files with 1019 additions and 687 deletions

View file

@ -2,14 +2,15 @@ package view
import (
"arimelody-web/controller"
"arimelody-web/model"
"arimelody-web/model/app"
"arimelody-web/model/twitch"
"arimelody-web/templates"
"fmt"
"net/http"
"os"
)
func IndexHandler(app *model.AppState) http.Handler {
func IndexHandler(app *app.AppState) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Method == http.MethodHead {
w.WriteHeader(http.StatusOK)
@ -18,10 +19,10 @@ func IndexHandler(app *model.AppState) http.Handler {
if r.URL.Path == "/" || r.URL.Path == "/index.html" {
type IndexData struct {
TwitchStatus *model.TwitchStreamInfo
TwitchStatus *twitch.StreamInfo
}
var err error
var twitchStatus *model.TwitchStreamInfo = nil
var twitchStatus *twitch.StreamInfo = nil
if app.Twitch != nil && len(app.Config.Twitch.Broadcaster) > 0 {
twitchStatus, err = controller.GetTwitchStatus(app, app.Config.Twitch.Broadcaster)
if err != nil {