Skip to content

Commit

Permalink
refactor: change app to appController
Browse files Browse the repository at this point in the history
  • Loading branch information
yoojinko committed Sep 19, 2023
1 parent f8f28f4 commit 846f0f2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/ainize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Middleware from "./middlewares/middleware";
import { getBlockChainEndpoint } from "./constants";
import Handler from "./handlers/handler";
import Wallet from "./modules/wallet";
import App from "./modules/app";
import AppController from "./controller/appController";
import DepositService from "./modules/service/depositService";
import UseService from "./modules/service/useService";
import Service from "./modules/service";
Expand All @@ -16,14 +16,13 @@ export default class Ainize {
middleware: Middleware;
handler: Handler;
wallet: Wallet;
app:App;
appController: AppController = AppController.getInstance();
service: Service;
admin: Admin;

constructor(chainId: 1|0, privateKey?: string ) {
const blockChainEndpoint = getBlockChainEndpoint(chainId);
this.ain = new Ain(blockChainEndpoint, chainId);
this.app = new App(this);
this.cache = new NodeCache();
this.middleware = new Middleware(this.cache);
this.handler = new Handler(this);
Expand All @@ -34,9 +33,17 @@ export default class Ainize {
this.admin = new Admin(this, depositService, useService);
}

// FIXME(yoojin): add config type and change param type.
deploy(modelName: string, config: any) {
// TODO(yoojin, woojae): Deploy container, advanced.
// TODO(yoojin): add createApp
// this.appController.createApp(modelName, )
}

model(modelName: string) {
return new Model(modelName);
}

test() {
console.log("test");
}
Expand Down

0 comments on commit 846f0f2

Please sign in to comment.