fix module
This commit is contained in:
parent
66d4d58dd1
commit
39cebda0b9
|
@ -1,6 +1,5 @@
|
|||
import { Path, Route } from '../../domain/route.types';
|
||||
import { GeorouterSettings } from '../types/georouter-settings.type';
|
||||
import { Path } from '../types/path.type';
|
||||
import { Route } from '../types/route.type';
|
||||
|
||||
export interface GeorouterPort {
|
||||
routes(paths: Path[], settings: GeorouterSettings): Promise<Route[]>;
|
||||
|
|
|
@ -3,6 +3,7 @@ import { CqrsModule } from '@nestjs/cqrs';
|
|||
import {
|
||||
DIRECTION_ENCODER,
|
||||
GEODESIC,
|
||||
GEOROUTER,
|
||||
PARAMS_PROVIDER,
|
||||
} from './geography.di-tokens';
|
||||
import { DefaultParamsProvider } from './infrastructure/default-params-provider';
|
||||
|
@ -10,6 +11,8 @@ import { PostgresDirectionEncoder } from './infrastructure/postgres-direction-en
|
|||
import { GetBasicRouteController } from './interface/controllers/get-basic-route.controller';
|
||||
import { RouteMapper } from './route.mapper';
|
||||
import { Geodesic } from './infrastructure/geodesic';
|
||||
import { GraphhopperGeorouter } from './infrastructure/graphhopper-georouter';
|
||||
import { HttpModule } from '@nestjs/axios';
|
||||
|
||||
const mappers: Provider[] = [RouteMapper];
|
||||
|
||||
|
@ -22,6 +25,10 @@ const adapters: Provider[] = [
|
|||
provide: DIRECTION_ENCODER,
|
||||
useClass: PostgresDirectionEncoder,
|
||||
},
|
||||
{
|
||||
provide: GEOROUTER,
|
||||
useClass: GraphhopperGeorouter,
|
||||
},
|
||||
{
|
||||
provide: GEODESIC,
|
||||
useClass: Geodesic,
|
||||
|
@ -30,7 +37,7 @@ const adapters: Provider[] = [
|
|||
];
|
||||
|
||||
@Module({
|
||||
imports: [CqrsModule],
|
||||
imports: [CqrsModule, HttpModule],
|
||||
providers: [...mappers, ...adapters],
|
||||
exports: [RouteMapper, DIRECTION_ENCODER, GetBasicRouteController],
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue