From 0f25746a87dacf73568dc0316cdbdb3267844165 Mon Sep 17 00:00:00 2001 From: Peace Date: Thu, 12 Jun 2025 18:02:19 +0900 Subject: [PATCH] capsulize --- nest-start/src/app.controller.ts | 9 +++++++-- nest-start/src/cats/cats.module.ts | 1 + nest-start/src/cats/cats.service.ts | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/nest-start/src/app.controller.ts b/nest-start/src/app.controller.ts index ca9928a..5f46dd3 100644 --- a/nest-start/src/app.controller.ts +++ b/nest-start/src/app.controller.ts @@ -1,12 +1,17 @@ import { Body, Controller, Get } from "@nestjs/common"; import { AppService } from "./app.service"; +import { CatsService } from "./cats/cats.service"; @Controller("") export class AppController { - constructor(private readonly appService: AppService) {} + constructor( + private readonly appService: AppService, + private readonly catsService: CatsService, + ) {} @Get() getHello(): string { - return this.appService.getHello(); + // return this.appService.getHello(); + return this.catsService.hiCatServiceProduct(); } } diff --git a/nest-start/src/cats/cats.module.ts b/nest-start/src/cats/cats.module.ts index a65e2ef..7ac909d 100644 --- a/nest-start/src/cats/cats.module.ts +++ b/nest-start/src/cats/cats.module.ts @@ -5,5 +5,6 @@ import { CatsService } from "./cats.service"; @Module({ controllers: [CatsController], providers: [CatsService], + exports: [CatsService], }) export class CatsModule {} diff --git a/nest-start/src/cats/cats.service.ts b/nest-start/src/cats/cats.service.ts index ae2808e..f680c27 100644 --- a/nest-start/src/cats/cats.service.ts +++ b/nest-start/src/cats/cats.service.ts @@ -1,4 +1,8 @@ import { Injectable } from "@nestjs/common"; @Injectable() -export class CatsService {} +export class CatsService { + hiCatServiceProduct() { + return "hello cat!"; + } +}