-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: updated shp maping * fix: update filed names in test
- Loading branch information
1 parent
0dfa791
commit cef3882
Showing
4 changed files
with
77 additions
and
40 deletions.
There are no files selected for viewing
18 changes: 10 additions & 8 deletions
18
src/models/layerMetadata/decorators/property/shp.decorator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
import 'reflect-metadata'; | ||
|
||
const shpMappingMetadataKey = Symbol('shpmapping'); | ||
const inputDataMappingMetadataKey = Symbol('inputDataMapping'); | ||
|
||
export interface IShpMapping { | ||
shpFile: ShapeFileType; | ||
export interface IDataMapping { | ||
dataFile: DataFileType; | ||
valuePath: string; | ||
isCustomLogic?: boolean; | ||
} | ||
|
||
export enum ShapeFileType { | ||
export enum DataFileType { | ||
FILES = 'Files', | ||
PRODUCT = 'Product', | ||
SHAPE_METADATA = 'ShapeMetadata', | ||
TFW = 'TFW', | ||
} | ||
|
||
export function shpMapping(shpmapping: IShpMapping): PropertyDecorator { | ||
return Reflect.metadata(shpMappingMetadataKey, shpmapping); | ||
export function inputDataMapping(dataMapping: IDataMapping): PropertyDecorator { | ||
return Reflect.metadata(inputDataMappingMetadataKey, dataMapping); | ||
} | ||
|
||
export function getShpMapping<T>(target: T, propertyKey: string): IShpMapping | undefined { | ||
return Reflect.getMetadata(shpMappingMetadataKey, target, propertyKey) as IShpMapping; | ||
export function getInputDataMapping<T>(target: T, propertyKey: string): IDataMapping | undefined { | ||
return Reflect.getMetadata(inputDataMappingMetadataKey, target, propertyKey) as IDataMapping; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters