|
|
|
@ -165,15 +165,15 @@ export class AppController {
|
|
|
|
|
|
|
|
|
|
|
|
@Post("/visitor")
|
|
|
|
@Post("/visitor")
|
|
|
|
async create(@Body() data: CreateVisitor) {
|
|
|
|
async create(@Body() data: CreateVisitor) {
|
|
|
|
if (new Date(data.apply_date).toString() == "Invalid Date") {
|
|
|
|
// if (new Date(data.apply_date).toString() == "Invalid Date") {
|
|
|
|
throw new BadRequestException("apply_date 格式不正确")
|
|
|
|
// throw new BadRequestException("apply_date 格式不正确")
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
if (new Date(data.start_date).toString() == "Invalid Date") {
|
|
|
|
// if (new Date(data.start_date).toString() == "Invalid Date") {
|
|
|
|
throw new BadRequestException("start_date 格式不正确")
|
|
|
|
// throw new BadRequestException("start_date 格式不正确")
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
if (new Date(data.end_date).toString() == "Invalid Date") {
|
|
|
|
// if (new Date(data.end_date).toString() == "Invalid Date") {
|
|
|
|
throw new BadRequestException("end_date 格式不正确")
|
|
|
|
// throw new BadRequestException("end_date 格式不正确")
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
return await this.dataSource.transaction(async transactionalEntityManager => {
|
|
|
|
return await this.dataSource.transaction(async transactionalEntityManager => {
|
|
|
|
|
|
|
|
|
|
|
|
const new_node_visitor = new NodeVisitorEntity();
|
|
|
|
const new_node_visitor = new NodeVisitorEntity();
|
|
|
|
|