1
0

user.controller.ts 482 B

123456789101112131415161718
  1. import { Controller, Get, Param } from '@nestjs/common';
  2. import { UserService } from './user.service';
  3. import { User } from '../../entity/user/user.interface';
  4. @Controller('users')
  5. export class UserController {
  6. constructor(private userService: UserService) {}
  7. @Get()
  8. findAll(): Promise<User[]> {
  9. return this.userService.findAll();
  10. }
  11. @Get(':id')
  12. findOne(@Param() params): Promise<User> {
  13. return this.userService.findOne(params.id);
  14. }
  15. }