add resId to cache DoricResource on native

This commit is contained in:
pengfei.zhou
2021-11-18 17:39:01 +08:00
committed by osborn
parent d746c5b4d4
commit 5b80e4e0e1
17 changed files with 107 additions and 23 deletions

View File

@@ -2,8 +2,10 @@ import { Modeling } from "./types";
export declare abstract class Resource implements Modeling {
type: string;
identifier: string;
resId: string;
constructor(type: string, identifier: string);
toModel(): {
resId: string;
type: string;
identifier: string;
};

View File

@@ -1,10 +1,13 @@
import { uniqueId } from "./uniqueId";
export class Resource {
constructor(type, identifier) {
this.resId = uniqueId("resource");
this.type = type;
this.identifier = identifier;
}
toModel() {
return {
resId: this.resId,
type: this.type,
identifier: this.identifier,
};