main
rustdreamer 2 years ago
parent 52fe6a618c
commit 6a90f156d0

@ -209,8 +209,19 @@ export class AppController {
@Get("/visitor") @Get("/visitor")
@ApiBearerAuth() @ApiBearerAuth()
async getVisiotr(@Query() { identity_card_no }: QueryVisitorByNumberDto, @Req() req: any) { async getVisiotr(@Query() { identity_card_no }: QueryVisitorByNumberDto, @Req() req: any) {
const node_visitor = await this.nodeOtherVisitorRepository.findOne({ where: { identity_card_no } }) const node_other_visitor: any = await this.nodeOtherVisitorRepository.findOne({
return node_visitor where: { identity_card_no },
order: {
created_date: "DESC"
}
});
if (node_other_visitor) {
const node_visitor = await this.nodeVisitorRepository.findOne({
where: { id: node_other_visitor.node_visitor_id }
})
node_other_visitor.info = node_visitor;
}
return node_other_visitor
} }
@Get("/visitors") @Get("/visitors")
@ -380,6 +391,7 @@ export class AppController {
data: result, data: result,
}; };
} catch (e) { } catch (e) {
console.log("e", e)
return { return {
code: -2, code: -2,
msg: e.message, msg: e.message,

@ -6,6 +6,7 @@ import { options } from './config/config.doc'
import { SwaggerModule } from '@nestjs/swagger'; import { SwaggerModule } from '@nestjs/swagger';
import { LoggingInterceptor } from './common/interceptor/logging.interceptor'; import { LoggingInterceptor } from './common/interceptor/logging.interceptor';
import * as fs from 'fs'; import * as fs from 'fs';
import { urlencoded, json } from 'express';
/** /**
* *
@ -38,6 +39,8 @@ async function bootstrap() {
}, },
credentials: true, credentials: true,
}); });
app.use(json({ limit: '50mb' }));
app.use(urlencoded({ extended: true, limit: '50mb' }));
// app.useGlobalFilters(new HttpExceptionFilter()); // app.useGlobalFilters(new HttpExceptionFilter());
app.useGlobalInterceptors(new LoggingInterceptor()); app.useGlobalInterceptors(new LoggingInterceptor());
if (process.env.DOC === 'true') { if (process.env.DOC === 'true') {

Loading…
Cancel
Save