-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
5 changed files
with
55 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Controller } from '@nestjs/common'; | ||
import { ApiTags } from '@nestjs/swagger'; | ||
import { StockBookmarkService } from './stock-bookmark.service'; | ||
|
||
@Controller('/api/stocks/bookmark') | ||
@ApiTags('주식 즐겨찾기 API') | ||
export class StockBookmarkController { | ||
constructor(private readonly stockBookmarkService: StockBookmarkService) {} | ||
} |
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,13 @@ | ||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; | ||
|
||
@Entity('bookmarks') | ||
export class Bookmark { | ||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column({ nullable: false }) | ||
stock_code: string; | ||
|
||
@Column({ nullable: false }) | ||
user_id: number; | ||
} |
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,13 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { Bookmark } from './stock-bookmark.entity'; | ||
import { StockBookmarkController } from './stock-bookmark.controller'; | ||
import { StockBookmarkRepository } from './stock-bookmark.repository'; | ||
import { StockBookmarkService } from './stock-bookmark.service'; | ||
|
||
@Module({ | ||
imports: [TypeOrmModule.forFeature([Bookmark])], | ||
controllers: [StockBookmarkController], | ||
providers: [StockBookmarkRepository, StockBookmarkService], | ||
}) | ||
export class StockBookmarkModule {} |
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,11 @@ | ||
import { DataSource, Repository } from 'typeorm'; | ||
import { Injectable } from '@nestjs/common'; | ||
import { InjectDataSource } from '@nestjs/typeorm'; | ||
import { Bookmark } from './stock-bookmark.entity'; | ||
|
||
@Injectable() | ||
export class StockBookmarkRepository extends Repository<Bookmark> { | ||
constructor(@InjectDataSource() private readonly dataSource: DataSource) { | ||
super(Bookmark, dataSource.createEntityManager()); | ||
} | ||
} |
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,9 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { StockBookmarkRepository } from './stock-bookmark.repository'; | ||
|
||
@Injectable() | ||
export class StockBookmarkService { | ||
constructor( | ||
private readonly stockBookmarkRepository: StockBookmarkRepository, | ||
) {} | ||
} |