后台context增加了sendMessage接口
This commit is contained in:
parent
397613b639
commit
43fac8001d
|
|
@ -19,4 +19,5 @@ export declare class BackendRuntimeContext<ED extends EntityDict> extends AsyncC
|
|||
getCurrentUserId(allowUnloggedIn?: boolean): string;
|
||||
toString(): string;
|
||||
isRoot(): boolean;
|
||||
sendMessage(data: ED['message']['CreateSingle']['data']): Promise<import("oak-domain/lib/types").OperationResult<ED>>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,6 +188,14 @@ var BackendRuntimeContext = /** @class */ (function (_super) {
|
|||
}
|
||||
return !!this.amIRoot;
|
||||
};
|
||||
BackendRuntimeContext.prototype.sendMessage = function (data) {
|
||||
return this.operate('message', {
|
||||
action: 'create',
|
||||
data: data,
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
};
|
||||
return BackendRuntimeContext;
|
||||
}(AsyncRowStore_1.AsyncContext));
|
||||
exports.BackendRuntimeContext = BackendRuntimeContext;
|
||||
|
|
|
|||
|
|
@ -177,4 +177,13 @@ export class BackendRuntimeContext<ED extends EntityDict> extends AsyncContext<E
|
|||
}
|
||||
return !!this.amIRoot;
|
||||
}
|
||||
|
||||
sendMessage(data: ED['message']['CreateSingle']['data']) {
|
||||
return this.operate('message', {
|
||||
action: 'create',
|
||||
data,
|
||||
}, {
|
||||
dontCollect: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue