diference

This commit is contained in:
IDONTSUDO 2024-08-21 16:31:41 +03:00
parent 7063e93c75
commit e748debd2f
5 changed files with 34 additions and 12 deletions

View file

@ -11,22 +11,23 @@ import { ITopicModel } from "../../topics/topic_database_model";
import { ExecInstanceTwinsProcessService } from "../services/exec_instance_twins_process_service";
export interface Topics {
topics: ITopicModel[];
topics: ITopicModel[];
}
export class ExecInstanceScenario extends CallbackStrategyWithIdQuery {
idValidationExpression: CoreValidation = new MongoIdValidation();
call = async (id: string): ResponseBase =>
(
await new ReadByIdDataBaseModelUseCase<IDigitalTwinsInstanceModel>(DigitalTwinsInstanceDatabaseModel).call(id)
).map((document) =>
new ExecProcessUseCase().call(
document.instancePath,
`python3 $GET_INTERFACES --path ${document.instancePath}`,
"",
new ExecInstanceTwinsProcessService(document.instancePath, document)
).map(
(document) => (
console.log(JSON.stringify(document)),
new ExecProcessUseCase().call(
document.instancePath,
`python3 $GET_INTERFACES --path ${document.instancePath} --package ${JSON.stringify(document)}`,
"",
new ExecInstanceTwinsProcessService(document.instancePath, document)
)
)
);
}

View file

@ -20,6 +20,12 @@ export const DigitalTwinsInstanceSchema = new Schema({
instancePath: {
type: String,
},
package: {
type: String,
},
executable: {
type: String,
},
formBuilder: {
type: Schema.Types.Mixed,
},

View file

@ -8,12 +8,18 @@ export const DigitalTwinsTemplateSchema = new Schema({
entity: String,
description: String,
command: String,
package: {
type: String,
},
executable: {
type: String,
},
interfaces: {
cmd: String,
},
formBuilder:{
formBuilder: {
type: Schema.Types.Mixed,
}
},
}).plugin(require("mongoose-autopopulate"));
export const digitalTwinsTemplateSchema = "digital_twins_templates";