diff --git a/api/handlers/artist_handler.go b/api/handlers/artist_handler.go index 1cb8965..aabba97 100644 --- a/api/handlers/artist_handler.go +++ b/api/handlers/artist_handler.go @@ -21,7 +21,7 @@ func NewArtistHandler(repo repository.ArtistRepository) *ArtistHandler { // @Produce json // @Success 200 {array} map[string]interface{} // @Failure 500 {object} ErrorResponse -// @Router /artist/getAll [get] +// @Router /api/v1/artists [get] func (handler *ArtistHandler) GetAll(c *gin.Context) { artists, err := handler.repo.GetAll(c.Request.Context()) if err != nil { diff --git a/api/handlers/user_handler.go b/api/handlers/user_handler.go index d9209d0..cc6400b 100644 --- a/api/handlers/user_handler.go +++ b/api/handlers/user_handler.go @@ -51,7 +51,7 @@ type ErrorResponse struct { // @Success 201 {object} CreateUserResponse // @Failure 400 {object} ErrorResponse // @Failure 500 {object} ErrorResponse -// @Router /user/create [post] +// @Router /api/v1/users/create [post] func (h *UserHandler) CreateUser(c *gin.Context) { var req CreateUserRequest if err := c.ShouldBindJSON(&req); err != nil { @@ -90,7 +90,7 @@ func (h *UserHandler) CreateUser(c *gin.Context) { // @Success 200 {object} UsernameResponse // @Failure 400 {object} ErrorResponse // @Failure 500 {object} ErrorResponse -// @Router /user/getUserNameByID/{id} [get] +// @Router /api/v1/users/{id} [get] func (h *UserHandler) GetUsernameByID(c *gin.Context) { idParam := c.Param("id") var pgID pgtype.UUID diff --git a/api/routes/router.go b/api/routes/router.go index 2ae698d..e486723 100644 --- a/api/routes/router.go +++ b/api/routes/router.go @@ -10,7 +10,7 @@ import ( ) func Routes(router *gin.Engine, userHandler *handlers.UserHandler, artistHandler *handlers.ArtistHandler) { - root := router.Group("/") + root := router.Group("/api/v1") { root.GET("/ping", func(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"message": "pong"})