forked from swapnil.bendal/TypeScript-Backend-Template
[added] - inversify for inversion of control (IoC) container
This commit is contained in:
@@ -2,11 +2,15 @@ import { Request, Response } from 'express';
|
||||
import { IProductInteractor } from '../interfaces/IProductInteractor';
|
||||
import ApiResponse from '../utils/helper/ApiResponse';
|
||||
import { AsyncHandler } from '../utils/handler/async.handler';
|
||||
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { INTERFACE_TYPE } from '../utils';
|
||||
@injectable()
|
||||
export class ProductController {
|
||||
private interactor: IProductInteractor;
|
||||
|
||||
constructor(interactor: IProductInteractor) {
|
||||
constructor(
|
||||
@inject(INTERFACE_TYPE.ProductInteractor) interactor: IProductInteractor
|
||||
) {
|
||||
this.interactor = interactor;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user