mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
26 lines
623 B
Go
26 lines
623 B
Go
package controller
|
|
|
|
import (
|
|
service "gitlab.com/mbugroup/lti-api.git/internal/modules/constants/services"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
type ConstantController struct {
|
|
ConstantService service.ConstantService
|
|
}
|
|
|
|
func NewConstantController(constantService service.ConstantService) *ConstantController {
|
|
return &ConstantController{
|
|
ConstantService: constantService,
|
|
}
|
|
}
|
|
|
|
func (ctrl *ConstantController) GetAll(c *fiber.Ctx) error {
|
|
data, err := ctrl.ConstantService.GetAll(c)
|
|
if err != nil {
|
|
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
|
|
}
|
|
return c.Status(fiber.StatusOK).JSON(data)
|
|
}
|