dcbot/internal/service/coords.go

23 lines
490 B
Go
Raw Normal View History

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)))
}