From 1d27504c1134e88047795ac31b5148606f2ad04d Mon Sep 17 00:00:00 2001 From: sunghwki Date: Mon, 18 Nov 2024 20:10:27 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20typeorm=20=EC=9D=98?= =?UTF-8?q?=EC=A1=B4=EC=84=B1=20=EC=84=A4=EC=B9=98=20=EB=B0=8F=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/scraper/openapi/api/openapiMinuteData.api.ts | 2 ++ .../src/scraper/openapi/api/openapiPeriodData.api.ts | 4 +++- .../backend/src/scraper/openapi/openapi-scraper.module.ts | 8 +++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/scraper/openapi/api/openapiMinuteData.api.ts b/packages/backend/src/scraper/openapi/api/openapiMinuteData.api.ts index c00dcabf..cbc43334 100644 --- a/packages/backend/src/scraper/openapi/api/openapiMinuteData.api.ts +++ b/packages/backend/src/scraper/openapi/api/openapiMinuteData.api.ts @@ -10,7 +10,9 @@ import { import { openApiToken } from './openapiToken.api'; import { Stock } from '@/stock/domain/stock.entity'; import { StockData, StockMinutely } from '@/stock/domain/stockData.entity'; +import { Injectable } from '@nestjs/common'; +@Injectable() export class OpenapiMinuteData { private stock: Stock[]; private readonly entity = StockMinutely; diff --git a/packages/backend/src/scraper/openapi/api/openapiPeriodData.api.ts b/packages/backend/src/scraper/openapi/api/openapiPeriodData.api.ts index 8253f4ad..74526d54 100644 --- a/packages/backend/src/scraper/openapi/api/openapiPeriodData.api.ts +++ b/packages/backend/src/scraper/openapi/api/openapiPeriodData.api.ts @@ -16,6 +16,7 @@ import { StockMonthly, StockYearly, } from '@/stock/domain/stockData.entity'; +import { Injectable } from '@nestjs/common'; const DATE_TO_ENTITY = { D: StockDaily, @@ -33,11 +34,12 @@ const DATE_TO_MONTH = { const INTERVALS = 4000; +@Injectable() export class OpenapiPeriodData { private readonly url: string = '/uapi/domestic-stock/v1/quotations/inquire-daily-itemchartprice'; public constructor(private readonly datasourse: DataSource) { - //this.getItemChartPriceCheck(); + this.getItemChartPriceCheck(); } @Cron('0 1 * * 1-5') diff --git a/packages/backend/src/scraper/openapi/openapi-scraper.module.ts b/packages/backend/src/scraper/openapi/openapi-scraper.module.ts index b6cfcda7..00dca421 100644 --- a/packages/backend/src/scraper/openapi/openapi-scraper.module.ts +++ b/packages/backend/src/scraper/openapi/openapi-scraper.module.ts @@ -2,9 +2,15 @@ import { Module } from '@nestjs/common'; import { OpenapiMinuteData } from './api/openapiMinuteData.api'; import { OpenapiPeriodData } from './api/openapiPeriodData.api'; import { OpenapiScraperService } from './openapi-scraper.service'; +import { DataSource } from 'typeorm'; +import { TypeOrmModule } from '@nestjs/typeorm'; +import { Stock } from '@/stock/domain/stock.entity'; +import { StockDaily, StockMinutely, StockMonthly, StockWeekly, StockYearly } from '@/stock/domain/stockData.entity'; +import { StockLiveData } from '@/stock/domain/stockLiveData.entity'; +import { StockDetail } from '@/stock/domain/stockDetail.entity'; @Module({ - imports: [], + imports: [TypeOrmModule.forFeature([Stock, StockMinutely , StockDaily, StockWeekly, StockMonthly, StockYearly, StockLiveData, StockDetail])], controllers: [], providers: [OpenapiPeriodData, OpenapiMinuteData, OpenapiScraperService], })