from datetime import datetime

from models import db
from peewee import *

class TgPhoneDevices(Model):
    id = AutoField()  # 自动递增的主键
    area_code = CharField(null=True, max_length=255, help_text='电话号码区号')  # 区号
    phone_number = CharField(null=True, max_length=255, help_text='电话号码')  # 电话号码
    device_model = CharField(null=True, max_length=255, help_text='设备型号')  # 设备型号
    system_version = CharField(null=True, max_length=255, help_text='系统版本')  # 系统版本
    app_version = CharField(null=True, max_length=255, help_text='应用版本')  # 应用版本
    lang_code = CharField(null=True, max_length=255, help_text='语言代码')  # 语言代码
    system_lang_code = CharField(null=True, max_length=255, help_text='系统语言代码')  # 系统语言代码
    is_valid_session = IntegerField(null=True, help_text='Session 状态')  # Session 状态
    api_id = IntegerField(null=True, help_text='API ID')  # API ID
    kick_status = IntegerField(null=True, help_text='API ID')  # API ID
    api_hash = CharField(null=True, max_length=255, help_text='API Hash')  # API Hash
    phone = CharField(null=True, max_length=255, help_text='完整电话号码')  # 电话号码
    create_time = DateTimeField(default=datetime.now, help_text='记录创建时间')
    code = CharField(null=True, )  # 电话号码
    to_code = CharField(null=True, )  # 电话号码
    server_ip = CharField(null=True, )  # 电话号码
    proxy_type = CharField(null=True, )  # 电话号码
    addr = CharField(null=True, )  # 电话号码
    port = CharField(null=True, )  # 电话号码
    user = CharField(null=True, )  # 电话号码
    pwd = CharField(null=True, )  # 电话号码
    device_start = IntegerField(null=True, )  # API ID

    class Meta:
        database = db  # 指定数据库
        table_name = 'tg_phone_devices'  # 指定表名称