add state history
This commit is contained in:
29
local/service/stateHistory.go
Normal file
29
local/service/stateHistory.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 StateHistoryService struct {
|
||||
repository *repository.StateHistoryRepository
|
||||
}
|
||||
|
||||
func NewStateHistoryService(repository *repository.StateHistoryRepository) *StateHistoryService {
|
||||
return &StateHistoryService{
|
||||
repository: repository,
|
||||
}
|
||||
}
|
||||
|
||||
// GetAll
|
||||
// Gets All rows from StateHistory table.
|
||||
//
|
||||
// Args:
|
||||
// context.Context: Application context
|
||||
// Returns:
|
||||
// string: Application version
|
||||
func (as StateHistoryService) GetAll(ctx *fiber.Ctx, id int) *[]model.StateHistory {
|
||||
return as.repository.GetAll(ctx.UserContext(), id)
|
||||
}
|
||||
Reference in New Issue
Block a user