21 lines
572 B
TypeScript
21 lines
572 B
TypeScript
import { Controller, Get, Param } from '@nestjs/common';
|
|
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
|
import { PlansService } from './plans.service';
|
|
|
|
@ApiTags('Plans')
|
|
@Controller('plans')
|
|
export class PlansController {
|
|
constructor(private readonly plansService: PlansService) {}
|
|
|
|
@Get()
|
|
@ApiOperation({ summary: 'Get all plans' })
|
|
getAllPlans() {
|
|
return this.plansService.getAllPlans();
|
|
}
|
|
|
|
@Get(':id')
|
|
@ApiOperation({ summary: 'Get plan by ID' })
|
|
getPlanById(@Param('id') id: string) {
|
|
return this.plansService.getPlanById(id);
|
|
}
|
|
}
|