api with functioning managment
This commit is contained in:
29
local/service/server.go
Normal file
29
local/service/server.go
Normal file
@@ -0,0 +1,29 @@
|
||||
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())
|
||||
}
|
||||
Reference in New Issue
Block a user