Files
kontor/kontor-gin/internal/handlers/comic.go
T
Thomas Peetz f0f1819a1f
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
umstellung auf Service und Repository Verwendung - WIP
2026-09-25 16:57:23 +02:00

22 lines
409 B
Go

package handlers
import (
"kontor-api-gin/internal/service"
"net/http"
"github.com/gin-gonic/gin"
)
type ComicHandler struct {
Service *service.ComicService
}
func (handler *ComicHandler) List(c *gin.Context) {
comics, err := handler.Service.List(c.Request.Context())
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, comics)
}