This commit is contained in:
2025-11-03 12:24:01 +02:00
commit 0806865287
177 changed files with 18453 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package handlers
import (
"go-server/internal/service"
"net/http"
"github.com/gin-gonic/gin"
)
type CategoryController struct {
categoryService *service.CategoryService
}
func NewCategoryController(categoryService *service.CategoryService) *CategoryController {
return &CategoryController{categoryService: categoryService}
}
func (h *CategoryController) GetAll(c *gin.Context) {
categories, err := h.categoryService.GetAll(c)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, categories)
}