Files
acc-server-manager/local/service/server.go
2025-02-05 00:26:12 +01:00

30 lines
610 B
Go

package service
import (
"acc-server-manager/local/model"
"acc-server-manager/local/repository"
"github.com/gofiber/fiber/v2"
)
type ServerService struct {
repository *repository.ServerRepository
}
func NewServerService(repository *repository.ServerRepository) *ServerService {
return &ServerService{
repository: repository,
}
}
// GetAll
// Gets All rows from Server table.
//
// Args:
// context.Context: Application context
// Returns:
// string: Application version
func (as ServerService) GetAll(ctx *fiber.Ctx) *[]model.Server {
return as.repository.GetAll(ctx.UserContext())
}