init
This commit is contained in:
28
local/service/api.go
Normal file
28
local/service/api.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"acc-server-manager/local/utl/configs"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
type ApiService struct {
|
||||
}
|
||||
|
||||
func NewApiService() *ApiService {
|
||||
return &ApiService{}
|
||||
}
|
||||
|
||||
/*
|
||||
GetFirst
|
||||
|
||||
Gets first row from API table.
|
||||
|
||||
Args:
|
||||
context.Context: Application context
|
||||
Returns:
|
||||
string: Application version
|
||||
*/
|
||||
func (as ApiService) GetFirst(ctx *fiber.Ctx) string {
|
||||
return configs.Version
|
||||
}
|
||||
17
local/service/service.go
Normal file
17
local/service/service.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"go.uber.org/dig"
|
||||
)
|
||||
|
||||
/*
|
||||
InitializeServices
|
||||
|
||||
Initializes Dependency Injection modules for services
|
||||
|
||||
Args:
|
||||
*dig.Container: Dig Container
|
||||
*/
|
||||
func InitializeServices(c *dig.Container) {
|
||||
c.Provide(NewApiService)
|
||||
}
|
||||
Reference in New Issue
Block a user