-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
256 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { AppController } from './app.controller'; | ||
|
||
describe('AppController', () => { | ||
let controller: AppController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [AppController], | ||
}).compile(); | ||
|
||
controller = module.get<AppController>(AppController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Controller, Get } from '@nestjs/common'; | ||
|
||
@Controller() | ||
export class AppController { | ||
/** | ||
* 접근 가능한 메인 주소 | ||
*/ | ||
@Get() | ||
sayHello() { | ||
return ` | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>keyword-on</title> | ||
<meta charset='utf8'> | ||
</head> | ||
<body> | ||
<h1>Keyword-on에 어서 오세요</h1> | ||
<p>키워드 온 메인 페이지입니다!</p> | ||
</body> | ||
</html>`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { BatchService } from './batch.service'; | ||
import { ScheduleModule } from '@nestjs/schedule'; | ||
import { SearchModule } from 'src/search/search.module'; | ||
|
||
@Module({ | ||
imports: [ScheduleModule.forRoot(), SearchModule], | ||
providers: [BatchService], | ||
}) | ||
export class BatchModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { BatchService } from './batch.service'; | ||
|
||
describe('BatchService', () => { | ||
let service: BatchService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [BatchService], | ||
}).compile(); | ||
|
||
service = module.get<BatchService>(BatchService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Injectable, Logger } from '@nestjs/common'; | ||
import { Cron } from '@nestjs/schedule'; | ||
|
||
import { SearchService } from 'src/search/search.service'; | ||
|
||
@Injectable() | ||
export class BatchService { | ||
private readonly logger = new Logger(BatchService.name); | ||
constructor(private searchService: SearchService) {} | ||
|
||
@Cron('0 0 0 * * *') | ||
async runSchedule() { | ||
try { | ||
const result = await this.searchService.clearPopularKeywords(); | ||
this.logger.log(`clear popular keyword list. delete count: ${result}`); | ||
} catch (e) { | ||
this.logger.error('wrong with clearPopKeywords', e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Expose } from 'class-transformer'; | ||
import { Keyword } from '../../../keyword/keyword.entity'; | ||
|
||
export class OutKeywordDto | ||
implements Pick<Keyword, 'id' | 'name' | 'description'> | ||
{ | ||
@Expose() | ||
id: number; | ||
|
||
@Expose() | ||
name: string; | ||
|
||
@Expose() | ||
description: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.