You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

from tortoise import fields, models
from tortoise.indexes import Index
class Hikvision(models.Model):
id = fields.UUIDField(pk = True)
terminal_id = fields.UUIDField(description = '终端ID')
cabinet_id = fields.UUIDField(description = '柜体ID')
ip = fields.CharField(max_length = 255, description = 'IP地址')
channel = fields.CharField(max_length = 50, description = '通道号')
name = fields.CharField(max_length = 255, description = '名称备注')
rank = fields.SmallIntField(null = True)
camera_type = fields.IntField(default=1,null=False,description="摄像头类型0USB摄像头1海康网络摄像头")
username = fields.CharField(default="admin",max_length = 255, description = '网络摄像头账号')
password = fields.CharField(default="yanei123456",max_length = 255, description = '网络摄像头密码')
created_at = fields.DatetimeField(auto_now_add = True)
updated_at = fields.DatetimeField(auto_now = True)
class Meta:
table = 'hikvisions'
table_description = '实时监控表'
unique_together = (('terminal_id', 'ip', 'channel'))