import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { CommentEntity } from 'kkk-lib/article/entity/comment.entity'; @Injectable() export class CommentService { constructor( @InjectRepository(CommentEntity) private readonly commentRepository: Repository, ) {} // 创建的方法 async create(commentEntityDto: any): Promise { return await this.commentRepository.save(commentEntityDto); } }