调整了publish的事件的数据,返回event

This commit is contained in:
Xu Chang 2024-02-04 17:01:59 +08:00
parent cff668bfae
commit 05b8df221f
4 changed files with 6 additions and 6 deletions

View File

@ -164,7 +164,7 @@ class AppLoader extends types_1.AppLoader {
const message = context.getMessage();
await context.commit();
return {
opRecords: opRecords.map(ele => (0, lodash_1.omit)(ele, 'id')),
opRecords,
message,
result,
};

View File

@ -67,10 +67,10 @@ class DataSubscriber {
const { instanceId } = (0, env_1.getClusterInfo)();
// console.log('publishEvent', instanceId);
if (sid) {
this.ns.to(event).except(sid).emit('data', records);
this.ns.to(event).except(sid).emit('data', records, event);
}
else {
this.ns.to(event).emit('data', records);
this.ns.to(event).emit('data', records, event);
}
}
publishVolatileTrigger(entity, name, instanceNumber, ids, cxtStr, option) {

View File

@ -220,7 +220,7 @@ export class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends Backe
const message = context.getMessage();
await context.commit();
return {
opRecords: (opRecords as CreateOpResult<ED, keyof ED>[]).map(ele => omit(ele, 'id')),
opRecords,
message,
result,
};

View File

@ -85,10 +85,10 @@ export default class DataSubscriber<ED extends EntityDict & BaseEntityDict, Cont
const { instanceId } = getClusterInfo();
// console.log('publishEvent', instanceId);
if (sid) {
this.ns.to(event).except(sid).emit('data', records);
this.ns.to(event).except(sid).emit('data', records, event);
}
else {
this.ns.to(event).emit('data', records);
this.ns.to(event).emit('data', records, event);
}
}