Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

Mini

[Nest JS] memory repository 2 DB repository / 게시글 조회 / 본문

JS/Nest.js

[Nest JS] memory repository 2 DB repository / 게시글 조회 /

Mini_96 2024. 8. 17. 23:27

import { Injectable, NotFoundException } from "@nestjs/common";
import { BoardStatus } from "./board-statuss.enum.";
import {v1 as uuid} from 'uuid';
import { CreateBoardDto } from "./dto/create-board.dto";
import { InjectRepository } from "@nestjs/typeorm";
import { BoardRepository } from "./board.repository";

@Injectable()
export class BoardsService {
  constructor(
    @InjectRepository(BoardRepository) //변수에 의존성 주입해줘
    private boardRepository: BoardRepository) {

  }

서비스에서 리포지토리를 멤버변수로 가지고있음.