mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
27 lines
639 B
Go
27 lines
639 B
Go
package service
|
|
|
|
import (
|
|
repository "gitlab.com/mbugroup/lti-api.git/internal/modules/constants/repositories"
|
|
|
|
"github.com/go-playground/validator/v10"
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
type ConstantService interface {
|
|
GetAll(ctx *fiber.Ctx) (map[string]interface{}, error)
|
|
}
|
|
|
|
type constantService struct {
|
|
Repository repository.ConstantRepository
|
|
}
|
|
|
|
func NewConstantService(repo repository.ConstantRepository, validate *validator.Validate) ConstantService {
|
|
return &constantService{
|
|
Repository: repo,
|
|
}
|
|
}
|
|
|
|
func (s constantService) GetAll(c *fiber.Ctx) (map[string]interface{}, error) {
|
|
return s.Repository.GetConstants(), nil
|
|
}
|