feat: add get a game service and fake database

This commit is contained in:
Jeffrey Duroyon
2020-05-11 01:00:02 +02:00
parent 3ab5c7916f
commit 8d40337a1c
4 changed files with 117 additions and 11 deletions

View File

@@ -27,9 +27,12 @@ type Config struct {
}
type handlersContext struct {
db dao.Database
validator *validator.Validate
userService *service.UserService
db dao.Database
validator *validator.Validate
userService *service.UserService
gameService *service.GameService
cageService *service.CageService
hamsterService *service.HamsterService
}
func NewRouter(config *Config) *gin.Engine {
@@ -58,6 +61,10 @@ func NewRouter(config *Config) *gin.Engine {
}
hc.validator = newValidator()
hc.userService = service.NewUserService(hc.db)
hc.gameService = service.NewGameService(hc.db)
hc.cageService = service.NewCageService(hc.db)
hc.hamsterService = service.NewHamsterService(hc.db)
public := router.Group("/")
public.Handle(http.MethodGet, "/_health", hc.GetHealth)