import { Logger, SingletonRepository } from "."; export class Market { public static async getInstance() { if (this.instance.size === 0) { const result = await SingletonRepository.getInstance().select( "market", {} ); for (const data of result) { this.instance.set(data.dataValues.market_idx, data.dataValues); } Logger.getInstance().info("created the market entity map"); } return this.instance; } private static instance = new Map(); } export class Product { public static async getInstance() { if (this.instance.size === 0) { const result = await SingletonRepository.getInstance().select( "product", {} ); for (const data of result) { this.instance.set(data.dataValues.prod_idx, data.dataValues); } Logger.getInstance().info("created the product entity map"); } return this.instance; } private static instance = new Map(); }