import { Controller , Get , Post , Body } from '@nestjs/common' ; import { UserService } from './user.service' ; import { User } from './user.model' ; @ Controller ( 'users' ) export class UserController { constructor ( private readonly userService ) { } @ Get ( ) async getUser ( ) { return await this . userService . findAll ( ) ; } @ Post ( ) async create ( @ Body ( ) user ) { return await this . userService . create ( user ) ; } }