Add initial database setup and user/artist management functionality

This commit is contained in:
zardzul
2026-03-13 20:42:50 +01:00
parent 5fa23b0d1c
commit f81b28417e
26 changed files with 585 additions and 64 deletions
+25
View File
@@ -0,0 +1,25 @@
package handlers
import (
"net/http"
"zardzul/music-index/repository"
"github.com/gin-gonic/gin"
)
type ArtistHandler struct {
repo repository.ArtistRepository
}
func NewArtistHandler(repo repository.ArtistRepository) *ArtistHandler {
return &ArtistHandler{repo: repo}
}
func (handler *ArtistHandler) GetAll(c *gin.Context) {
artists, err := handler.repo.GetAll(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
}
c.JSON(http.StatusOK, artists)
}