mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2026-01-01 14:02:39 +00:00
basic ad entity without direction
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { DefaultParamsProviderPort } from '../core/application/ports/default-params-provider.port';
|
||||
import { DefaultParams } from '../core/application/types/default-params.type';
|
||||
|
||||
@Injectable()
|
||||
export class DefaultParamsProvider implements DefaultParamsProviderPort {
|
||||
constructor(private readonly _configService: ConfigService) {}
|
||||
getParams = (): DefaultParams => ({
|
||||
GEOROUTER_TYPE: this._configService.get('GEOROUTER_TYPE'),
|
||||
GEOROUTER_URL: this._configService.get('GEOROUTER_URL'),
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Coordinates } from '../core/application/types/coordinates.type';
|
||||
import { DirectionEncoderPort } from '../core/application/ports/direction-encoder.port';
|
||||
|
||||
export class PostgresDirectionEncoder implements DirectionEncoderPort {
|
||||
encode = (coordinates: Coordinates[]): string =>
|
||||
[
|
||||
"'LINESTRING(",
|
||||
coordinates.map((point) => [point.lon, point.lat].join(' ')).join(),
|
||||
")'",
|
||||
].join('');
|
||||
}
|
||||
Reference in New Issue
Block a user