All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #114
23 lines
490 B
Go
23 lines
490 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitea.dwysokinski.me/twhelp/dcbot/internal/domain"
|
|
)
|
|
|
|
type Coords struct {
|
|
twhelpSvc TWHelpService
|
|
}
|
|
|
|
func NewCoords(twhelpSvc TWHelpService) *Coords {
|
|
return &Coords{twhelpSvc: twhelpSvc}
|
|
}
|
|
|
|
func (c *Coords) Translate(ctx context.Context, version, server string, coords ...string) ([]domain.Village, error) {
|
|
if len(coords) == 0 {
|
|
return nil, nil
|
|
}
|
|
return c.twhelpSvc.ListVillagesCoords(ctx, version, server, coords, 0, int32(len(coords)))
|
|
}
|