适配新的domain
This commit is contained in:
parent
bd4b346135
commit
52d97b2574
|
|
@ -27,6 +27,7 @@ class DebugRunningContext<ED extends EntityDict> extends Context<ED> implements
|
|||
};
|
||||
|
||||
export async function createAspectProxy<ED extends EntityDict, AD extends Record<string, Aspect<ED>>>(
|
||||
cacheStore: CacheStore<ED>,
|
||||
storageSchema: StorageSchema<ED>,
|
||||
triggers: Array<Trigger<ED, keyof ED>>,
|
||||
applicationId: string,
|
||||
|
|
@ -40,7 +41,7 @@ export async function createAspectProxy<ED extends EntityDict, AD extends Record
|
|||
throw new Error('method not implemented');
|
||||
}
|
||||
else {
|
||||
// todo initialData
|
||||
// todo initialData
|
||||
const executor = new TriggerExecutor<ED>();
|
||||
const debugStore = new DebugStore<ED>(executor, storageSchema);
|
||||
triggers.forEach(
|
||||
|
|
@ -102,9 +103,10 @@ export class FrontContext<ED extends EntityDict, AD extends Record<string, Aspec
|
|||
initialData?: {
|
||||
[T in keyof ED]?: Array<ED[T]['OpSchema']>;
|
||||
}) {
|
||||
super(new CacheStore<ED>(storageSchema));
|
||||
const cacheStore = new CacheStore<ED>(storageSchema);
|
||||
super(cacheStore);
|
||||
|
||||
const ap = createAspectProxy<ED, AD>(storageSchema, triggers, applicationId, getTokenValue, aspectDict, initialData);
|
||||
const ap = createAspectProxy<ED, AD>(cacheStore, storageSchema, triggers, applicationId, getTokenValue, aspectDict, initialData);
|
||||
this.getAspectProxy = () => ap;
|
||||
}
|
||||
};
|
||||
|
|
@ -1,15 +1,13 @@
|
|||
import { RunningContext } from 'oak-domain/lib/types/Context';
|
||||
import { Schema as Token } from 'oak-domain/lib/entities/Token';
|
||||
import { EntityDict as BaseEntityDict} from 'oak-domain/lib/base-domain/EntityDict';
|
||||
import { EntityDict } from 'oak-domain/lib/types/Entity';
|
||||
import { Aspect } from 'oak-domain/lib/types/Aspect';
|
||||
import { EntityDict, OperationResult } from 'oak-domain/lib/types/Entity';
|
||||
|
||||
export async function loginMp<ED extends EntityDict> (params: { code: string }, context: RunningContext<ED>): Promise<Token> {
|
||||
export async function loginMp<ED extends EntityDict> (params: { code: string }, context: RunningContext<ED>): Promise<string> {
|
||||
const { rowStore } = context;
|
||||
throw new Error('method not implemented!');
|
||||
}
|
||||
|
||||
export async function loginByPassword<ED extends EntityDict>(params: { password: string, mobile: string }, context: RunningContext<ED>): Promise<Token> {
|
||||
export async function loginByPassword<ED extends EntityDict>(params: { password: string, mobile: string }, context: RunningContext<ED>): Promise<string> {
|
||||
const { rowStore } = context;
|
||||
throw new Error('method not implemented!');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue