Added config concept
This commit is contained in:
@@ -4,7 +4,7 @@ import { readFile, set_fs } from 'xlsx';
|
||||
import * as fs from 'node:fs';
|
||||
set_fs(fs);
|
||||
|
||||
export class DoorService extends AbstractService<string, Door[]> {
|
||||
export class DoorService extends AbstractService<any, Door[]> {
|
||||
receptionChannel(): string {
|
||||
return WindowApiConst.PROJECT_INPUT;
|
||||
}
|
||||
@@ -13,9 +13,9 @@ export class DoorService extends AbstractService<string, Door[]> {
|
||||
return WindowApiConst.PROJECT_OUTPUT;
|
||||
}
|
||||
|
||||
process(input: string): Promise<Door[]> {
|
||||
process(input: {name: string, path: string}): Promise<Door[]> {
|
||||
return new Promise((resolve) => {
|
||||
const workbook = readFile(`./assets/${input}`);
|
||||
const workbook = readFile(`${input.path}/${input.name}`);
|
||||
const workingSheet = workbook.Sheets['DEURLIJST'];
|
||||
const doorList: Door[] = [];
|
||||
|
||||
|
||||
@@ -48,4 +48,8 @@ export class FileListService extends AbstractService<void, any[]> {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
public setPaths(inputPaths: string[]) {
|
||||
this._paths = inputPaths;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user