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
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue