Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-domain into dev
This commit is contained in:
commit
c722412c62
|
|
@ -48,6 +48,7 @@ export declare abstract class AsyncContext<ED extends EntityDict> implements Con
|
|||
getMessage(): string | undefined;
|
||||
abstract isRoot(): boolean;
|
||||
abstract getCurrentUserId(allowUnloggedIn?: boolean): string | undefined;
|
||||
abstract setCurrentUserId(userId: string | undefined): void;
|
||||
abstract toString(): Promise<string>;
|
||||
abstract initialize(data: any): Promise<void>;
|
||||
abstract allowUserUpdate(): boolean;
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ function makeIntrinsicCTWs(schema, actionDefDict) {
|
|||
action: 'create',
|
||||
type: 'data',
|
||||
entity,
|
||||
priority: 10,
|
||||
priority: 10, // 优先级要高,先于真正的data检查进行
|
||||
checker: (data) => {
|
||||
if (data instanceof Array) {
|
||||
data.forEach(ele => {
|
||||
|
|
@ -181,7 +181,7 @@ function makeIntrinsicCTWs(schema, actionDefDict) {
|
|||
entity,
|
||||
action: 'create',
|
||||
type: 'logicalData',
|
||||
priority: types_1.CHECKER_MAX_PRIORITY,
|
||||
priority: types_1.CHECKER_MAX_PRIORITY, // 优先级要放在最低,所有前置的checker/trigger将数据完整之后再在这里检测
|
||||
checker: (operation, context) => {
|
||||
const { data } = operation;
|
||||
if (data instanceof Array) {
|
||||
|
|
@ -197,9 +197,9 @@ function makeIntrinsicCTWs(schema, actionDefDict) {
|
|||
}
|
||||
}, {
|
||||
entity,
|
||||
action: 'update',
|
||||
action: 'update', // 只检查update,其它状态转换的action应该不会涉及unique约束的属性
|
||||
type: 'logicalData',
|
||||
priority: types_1.CHECKER_MAX_PRIORITY,
|
||||
priority: types_1.CHECKER_MAX_PRIORITY, // 优先级要放在最低,所有前置的checker/trigger将数据完整之后再在这里检测
|
||||
checker: (operation, context) => {
|
||||
const { data, filter: operationFilter } = operation;
|
||||
if (data) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference types="node" />
|
||||
/**
|
||||
* 防止assert打包体积过大,从这里引用
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -219,6 +219,8 @@ export abstract class AsyncContext<ED extends EntityDict> implements Context {
|
|||
|
||||
abstract getCurrentUserId(allowUnloggedIn?: boolean): string | undefined;
|
||||
|
||||
abstract setCurrentUserId(userId: string | undefined): void; // 设置上下文userId,必须在root模式下才能调用
|
||||
|
||||
// 此接口将上下文变成可以serialized的字符串
|
||||
abstract toString(): Promise<string>;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue