main
rustdreamer 2 years ago
parent 52fe6a618c
commit 6a90f156d0

@ -209,8 +209,19 @@ export class AppController {
@Get("/visitor")
@ApiBearerAuth()
async getVisiotr(@Query() { identity_card_no }: QueryVisitorByNumberDto, @Req() req: any) {
const node_visitor = await this.nodeOtherVisitorRepository.findOne({ where: { identity_card_no } })
return node_visitor
const node_other_visitor: any = await this.nodeOtherVisitorRepository.findOne({
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")
@ -380,6 +391,7 @@ export class AppController {
data: result,
};
} catch (e) {
console.log("e", e)
return {
code: -2,
msg: e.message,

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

Loading…
Cancel
Save