33 lines
834 B
Python
33 lines
834 B
Python
|
#!/usr/bin/env python
|
|||
|
# -*- coding: utf-8 -*-
|
|||
|
|
|||
|
"""
|
|||
|
数据缓存模型
|
|||
|
对应vwed_datacache表
|
|||
|
"""
|
|||
|
|
|||
|
from sqlalchemy import Column, String
|
|||
|
from sqlalchemy.dialects.mysql import LONGTEXT
|
|||
|
from data.models.base import BaseModel
|
|||
|
|
|||
|
|
|||
|
class VWEDDataCache(BaseModel):
|
|||
|
"""
|
|||
|
数据缓存模型
|
|||
|
对应vwed_datacache表
|
|||
|
功能:存储系统配置和临时数据
|
|||
|
"""
|
|||
|
__tablename__ = 'vwed_datacache'
|
|||
|
|
|||
|
__table_args__ = {
|
|||
|
'mysql_engine': 'InnoDB',
|
|||
|
'mysql_charset': 'utf8mb4',
|
|||
|
'mysql_collate': 'utf8mb4_general_ci',
|
|||
|
'info': {'order_by': 'created_at DESC'}
|
|||
|
}
|
|||
|
|
|||
|
id = Column(String(255), primary_key=True, nullable=False, comment='缓存ID')
|
|||
|
data = Column(LONGTEXT, comment='缓存数据(JSON格式)')
|
|||
|
|
|||
|
def __repr__(self):
|
|||
|
return f"<VWEDDataCache(id='{self.id}')>"
|