UNPKG

nestjs-aop

Version:

<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/toss/nestjs-aop"> <img src="https://toss.tech/wp-content/uploads/2022/11/tech-article-nest-js-02.png" alt="Logo" height="200"> </a>

17 lines (14 loc) 406 B
import { Controller, Get, Query } from '@nestjs/common'; import { Cache } from '../cache'; import { FooService } from './foo.service'; @Controller() export class FooController { public getFooCount = 0; constructor(private readonly fooService: FooService) {} @Get('foo') @Cache() async getFoo(@Query('id') id: number) { this.getFooCount++; return await this.fooService.getFoo(id); } }