fix: minor changes
This commit is contained in:
parent
7336dcfb5d
commit
999b8d6591
|
|
@ -33,10 +33,22 @@ func (s *service) ListProviders(ctx context.Context, limit, offset int32) ([]dom
|
||||||
// Convert []dbgen.VirtualGameProvider to []domain.VirtualGameProvider
|
// Convert []dbgen.VirtualGameProvider to []domain.VirtualGameProvider
|
||||||
domainProviders := make([]domain.VirtualGameProvider, len(providers))
|
domainProviders := make([]domain.VirtualGameProvider, len(providers))
|
||||||
for i, p := range providers {
|
for i, p := range providers {
|
||||||
|
var logoDark *string
|
||||||
|
if p.LogoDark.Valid {
|
||||||
|
logoDark = &p.LogoDark.String
|
||||||
|
}
|
||||||
|
|
||||||
|
var logoLight *string
|
||||||
|
if p.LogoLight.Valid {
|
||||||
|
logoLight = &p.LogoLight.String
|
||||||
|
}
|
||||||
|
|
||||||
domainProviders[i] = domain.VirtualGameProvider{
|
domainProviders[i] = domain.VirtualGameProvider{
|
||||||
ProviderID: p.ProviderID,
|
ProviderID: p.ProviderID,
|
||||||
ProviderName: p.ProviderName,
|
ProviderName: p.ProviderName,
|
||||||
Enabled: p.Enabled,
|
Enabled: p.Enabled,
|
||||||
|
LogoDark: logoDark,
|
||||||
|
LogoLight: logoLight,
|
||||||
CreatedAt: p.CreatedAt.Time,
|
CreatedAt: p.CreatedAt.Time,
|
||||||
UpdatedAt: &p.UpdatedAt.Time,
|
UpdatedAt: &p.UpdatedAt.Time,
|
||||||
// Add other fields as needed
|
// Add other fields as needed
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,8 @@ func (s *Service) AddProviders(ctx context.Context, req domain.ProviderRequest)
|
||||||
popokParams := dbgen.CreateVirtualGameProviderParams{
|
popokParams := dbgen.CreateVirtualGameProviderParams{
|
||||||
ProviderID: "popok",
|
ProviderID: "popok",
|
||||||
ProviderName: "Popok Gaming",
|
ProviderName: "Popok Gaming",
|
||||||
LogoDark: pgtype.Text{String: "/static/logos/popok-dark.png", Valid: true}, // adjust as needed
|
LogoDark: pgtype.Text{String: fmt.Sprintf("%v/static/logos/popok-dark.png", s.cfg.PopOK.CallbackURL), Valid: true}, // adjust as needed
|
||||||
LogoLight: pgtype.Text{String: "/static/logos/popok-light.png", Valid: true}, // adjust as needed
|
LogoLight: pgtype.Text{String: fmt.Sprintf("%v/static/logos/popok-light.png", s.cfg.PopOK.CallbackURL), Valid: true}, // adjust as needed
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,8 @@ func NewApp(
|
||||||
// AllowCredentials: true,
|
// AllowCredentials: true,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
app.Static("/static", "./static")
|
||||||
|
|
||||||
s := &App{
|
s := &App{
|
||||||
atlasVirtualGameService: atlasVirtualGameService,
|
atlasVirtualGameService: atlasVirtualGameService,
|
||||||
veliVirtualGameService: veliVirtualGameService,
|
veliVirtualGameService: veliVirtualGameService,
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,8 @@ func (h *Handler) StartGame(c *fiber.Ctx) error {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// There needs to be a way to generate a sessionID
|
||||||
|
|
||||||
// Attach user ID to request
|
// Attach user ID to request
|
||||||
req.PlayerID = fmt.Sprintf("%d", userId)
|
req.PlayerID = fmt.Sprintf("%d", userId)
|
||||||
|
|
||||||
|
|
@ -144,6 +146,8 @@ func (h *Handler) StartGame(c *fiber.Ctx) error {
|
||||||
req.BrandID = h.Cfg.VeliGames.BrandID
|
req.BrandID = h.Cfg.VeliGames.BrandID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.IP = c.IP()
|
||||||
|
|
||||||
res, err := h.veliVirtualGameSvc.StartGame(context.Background(), req)
|
res, err := h.veliVirtualGameSvc.StartGame(context.Background(), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
h.InternalServerErrorLogger().Error("Failed to [VeliGameHandler]StartGame",
|
h.InternalServerErrorLogger().Error("Failed to [VeliGameHandler]StartGame",
|
||||||
|
|
@ -198,6 +202,8 @@ func (h *Handler) StartDemoGame(c *fiber.Ctx) error {
|
||||||
req.BrandID = h.Cfg.VeliGames.BrandID
|
req.BrandID = h.Cfg.VeliGames.BrandID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.IP = c.IP()
|
||||||
|
|
||||||
res, err := h.veliVirtualGameSvc.StartDemoGame(context.Background(), req)
|
res, err := h.veliVirtualGameSvc.StartDemoGame(context.Background(), req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
h.InternalServerErrorLogger().Error("Failed to [VeliGameHandler]StartDemoGame",
|
h.InternalServerErrorLogger().Error("Failed to [VeliGameHandler]StartDemoGame",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user