Moved around more code. Implemented more sqlc. Added support to generate swagger.
Added support for profiling. Removed the pkg module altogether. Everything except old sync is now using code generated by sqlc.
This commit is contained in:
@@ -3,9 +3,10 @@ package server
|
||||
import (
|
||||
"log"
|
||||
"music-server/internal/backend"
|
||||
"music-server/internal/database"
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type SyncHandler struct {
|
||||
@@ -16,13 +17,13 @@ func NewSyncHandler() *SyncHandler {
|
||||
}
|
||||
|
||||
func (s *SyncHandler) SyncGames(ctx echo.Context) error {
|
||||
backend.SyncGames()
|
||||
database.SyncGames()
|
||||
backend.Reset()
|
||||
return ctx.JSON(http.StatusOK, "Games are synced")
|
||||
}
|
||||
|
||||
func (s *SyncHandler) SyncGamesQuick(ctx echo.Context) error {
|
||||
backend.SyncGamesQuick()
|
||||
database.SyncGamesQuick()
|
||||
backend.Reset()
|
||||
return ctx.JSON(http.StatusOK, "Games are synced")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user