/
githubmirror
/
nest
Обзор
Документация
Войти
/
githubmirror
/
nest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
sample/21-serializer/src/app.controller.ts
23 строки
526 B
Kamil Myśliwiec
sample(@nestjs) update gateways and graphql sample
31 авг 2018, 13:24
Не верифицирован
31 авг 2018, 13:24
cae159e
Код
Авторство
О чём код?
import { ClassSerializerInterceptor, Controller, Get, UseInterceptors, } from '@nestjs/common'; import { RoleEntity } from './entities/role.entity'; import { UserEntity } from './entities/user.entity'; @Controller() @UseInterceptors(ClassSerializerInterceptor) export class AppController { @Get() findOne(): UserEntity { return new UserEntity({ id: 1, firstName: 'Kamil', lastName: 'Mysliwiec', password: 'password', role: new RoleEntity({ id: 1, name: 'admin' }), }); } }