config.dto.ts
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { ApiProperty } from "@nestjs/swagger"
import { IsNotEmpty, IsNumber } from "class-validator"
/*
model log_config {
id Int @id @default(autoincrement())
device_id Int @unique(map: "device_id") @default(0)
log_saved_days Int? @default(7) @db.TinyInt
created_at DateTime @default(now()) @db.Timestamp(0)
updated_at DateTime @default(now()) @db.Timestamp(0)
device device @relation(fields: [device_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "FK_log_config_device")
device_info device_info @relation(fields: [device_id], references: [device_id], onDelete: NoAction, onUpdate: NoAction, map: "FK_log_config_device_info")
user_fields log_config_userfield_relation[]
}*/
export class LogConfigDto {
@ApiProperty({
type: Number,
description: '设备信息ID',
default: 0
})
id: number
@ApiProperty({
type: Number,
description: '设备ID',
default: 0
})
@IsNumber({},{ message: '设备ID必须是数字'})
@IsNotEmpty({ message: '设备ID不能为空' })
device_id: number
@ApiProperty({
type: Number,
description: '日志保存天数',
default: ''
})
log_saved_days: number
@ApiProperty({
type: Number,
description: '创建时间',
default: ''
})
created_at: Date | string
@ApiProperty({
type: Date,
description: '更新时间',
default: ''
})
updated_at: Date | string
@ApiProperty({
type: Array,
description: '需要上传的用户字段',
default: []
})
user_fields: []
}