|
|
|
@ -1,4 +1,4 @@
|
|
|
|
import { BadRequestException, Body, Controller, Get, Post, Query, Req } from '@nestjs/common';
|
|
|
|
import { BadRequestException, Body, Controller, Get, Post, Put, Query, Req } from '@nestjs/common';
|
|
|
|
import { AppService } from './app.service';
|
|
|
|
import { AppService } from './app.service';
|
|
|
|
import * as fs from 'fs';
|
|
|
|
import * as fs from 'fs';
|
|
|
|
import { ApiBearerAuth, ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
import { ApiBearerAuth, ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
@ -48,6 +48,18 @@ export class VisitorList {
|
|
|
|
public nationality: string;
|
|
|
|
public nationality: string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export class UpdateVisitorNumber {
|
|
|
|
|
|
|
|
@ApiProperty({ description: "id" })
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
|
|
|
|
public id: string;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ description: "card_number" })
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
|
|
|
|
public card_number: string;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export class CreateVisitor {
|
|
|
|
export class CreateVisitor {
|
|
|
|
@ApiProperty({ description: "申请人" })
|
|
|
|
@ApiProperty({ description: "申请人" })
|
|
|
|
@IsString()
|
|
|
|
@IsString()
|
|
|
|
@ -347,6 +359,17 @@ export class AppController {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Put("/visitor/number")
|
|
|
|
|
|
|
|
async updateVisitor(@Body() data: UpdateVisitorNumber) {
|
|
|
|
|
|
|
|
const node_other_visitor = await this.nodeOtherVisitorRepository.findOne({ where: { id: data.id } })
|
|
|
|
|
|
|
|
if (!node_other_visitor) {
|
|
|
|
|
|
|
|
throw new BadRequestException("数据不存在")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
node_other_visitor.card_number = data.card_number;
|
|
|
|
|
|
|
|
const result = await this.nodeOtherVisitorRepository.save(node_other_visitor);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Post('upload/base64')
|
|
|
|
@Post('upload/base64')
|
|
|
|
async louploadBase64Filegin(
|
|
|
|
async louploadBase64Filegin(
|
|
|
|
@Body() input: any,
|
|
|
|
@Body() input: any,
|
|
|
|
|