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
+28
View File
@@ -0,0 +1,28 @@
package routes
import (
"net/http"
"zardzul/music-index/handlers"
"github.com/gin-gonic/gin"
)
func Routes(router *gin.Engine, userHandler *handlers.UserHandler, artistHandler *handlers.ArtistHandler) {
root := router.Group("/")
{
root.GET("/ping", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"message": "pong"})
})
}
user := root.Group("/user")
{
user.POST("/create", userHandler.CreateUser)
user.GET("/getUserNameByID/:id", userHandler.GetUsernameByID)
}
artist := root.Group("/artist")
{
artist.GET("/getAll", artistHandler.GetAll)
}
}