Implement swagger

This commit is contained in:
zardzul
2026-03-13 21:03:01 +01:00
parent 30298390a0
commit 0deee355c1
10 changed files with 652 additions and 4 deletions
+8
View File
@@ -15,10 +15,18 @@ func NewArtistHandler(repo repository.ArtistRepository) *ArtistHandler {
return &ArtistHandler{repo: repo}
}
// GetAll godoc
// @Summary List all artists
// @Tags artist
// @Produce json
// @Success 200 {array} map[string]interface{}
// @Failure 500 {object} ErrorResponse
// @Router /artist/getAll [get]
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()})
return
}
c.JSON(http.StatusOK, artists)