| 123456789101112131415161718 |
- import { Controller, Get, Param } from '@nestjs/common';
- import { UserService } from './user.service';
- import { User } from '../../entity/user/user.interface';
- @Controller('users')
- export class UserController {
- constructor(private userService: UserService) {}
- @Get()
- findAll(): Promise<User[]> {
- return this.userService.findAll();
- }
- @Get(':id')
- findOne(@Param() params): Promise<User> {
- return this.userService.findOne(params.id);
- }
- }
|