VWED_server/data/models/datacache.py

33 lines
834 B
Python
Raw Permalink Normal View History

2025-04-30 16:57:46 +08:00
#!/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}')>"