Generify job

This commit is contained in:
David Majdandžić
2023-03-30 00:36:15 +02:00
parent cb9c707f91
commit 963afb446a
2 changed files with 20 additions and 24 deletions

View File

@@ -61,6 +61,24 @@ export class Job {
return new Job({}, 1, 1);
}
update(req: any) {
if (req.body.source != this._pdu.source_addr) {
this._pdu.source_addr = req.body.source;
}
if (req.body.destination != this._pdu.destination_addr) {
this._pdu.destination_addr = req.body.destination;
}
if (req.body.message != this._pdu.short_message) {
this._pdu.short_message = req.body.message;
}
if (!!req.body.perSecond && req.body.perSecond != this._perSecond) {
this._perSecond = req.body.perSecond;
}
if (!!req.body.count && req.body.count != this._count) {
this._count = req.body.count;
}
}
serialize(): object {
return {
pdu: this.pdu,