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,26 @@
package handlers
import (
"net/http"
"go-server/internal/service"
"github.com/gin-gonic/gin"
)
type NutrientController struct {
service *service.NutrientService
}
func NewNutrientController(service *service.NutrientService) *NutrientController {
return &NutrientController{service}
}
func (c *NutrientController) GetAll(ctx *gin.Context) {
nutrients, err := c.service.GetAll(ctx)
if err != nil {
ctx.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
ctx.JSON(http.StatusOK, nutrients)
}