25 lines
466 B
Go
25 lines
466 B
Go
package usecase
|
|
|
|
import (
|
|
"truck-company/internal/domain"
|
|
"truck-company/internal/repository"
|
|
)
|
|
|
|
type UseCase struct {
|
|
AppRepo repository.AppRepo
|
|
}
|
|
|
|
func NewUseCase(r repository.AppRepo) *UseCase {
|
|
return &UseCase{
|
|
AppRepo: r,
|
|
}
|
|
}
|
|
|
|
func (u *UseCase) GetAllRoutes() ([]domain.Route, error) {
|
|
return u.AppRepo.GetAllRoutes()
|
|
}
|
|
|
|
func (u *UseCase) GetTransportByRoute(routeID int64) ([]domain.Transport, error) {
|
|
return u.AppRepo.GetTransportByRoute(routeID)
|
|
}
|