import Comment from '../infra/typeorm/entities/Comment' ; import IPostCommentsRepository from '../repositories/IPostCommentsRepository' ; import { inject , injectable } from 'tsyringe' ; @ injectable ( ) class IndexCommentsService { constructor ( @ inject ( 'PostCommentsRepository' ) private postCommentsRepository ) { } public async execute ( postId ) { return this . postCommentsRepository . findByPost ( postId ) ; } } export default IndexCommentsService ;