Added a new sync that uses hash
Added a new sync that uses hash and sqlc for the queries. Added db migration. Started adding a config file.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"music-server/pkg/server"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type Sync struct {
|
||||
@@ -25,6 +26,12 @@ func (s *Sync) SyncGamesQuick(ctx *gin.Context) {
|
||||
ctx.JSON(http.StatusOK, "Games are synced")
|
||||
}
|
||||
|
||||
func (s *Sync) SyncGamesNew(ctx *gin.Context) {
|
||||
response := server.SyncGamesNew()
|
||||
server.Reset()
|
||||
ctx.JSON(http.StatusOK, response)
|
||||
}
|
||||
|
||||
func (s *Sync) ResetGames(ctx *gin.Context) {
|
||||
server.ResetDB()
|
||||
ctx.JSON(http.StatusOK, "Games and songs are deleted from the database")
|
||||
|
||||
Reference in New Issue
Block a user