from tortoise import fields
from tortoise.models import Model


class BaseKeyword(Model):
    id = fields.IntField(pk=True)
    city = fields.CharField(max_length=64)
    job = fields.CharField(max_length=128)
    last_requested_date = fields.DateField(null=True)
    last_requested_at = fields.DatetimeField(null=True)
    created_at = fields.DatetimeField(auto_now_add=True)
    updated_at = fields.DatetimeField(auto_now=True)

    class Meta:
        abstract = True


class BossKeyword(BaseKeyword):
    class Meta:
        table = "boss_keyword"


class QcwyKeyword(BaseKeyword):
    class Meta:
        table = "qcwy_keyword"


class ZhilianKeyword(BaseKeyword):
    class Meta:
        table = "zhilian_keyword"

