VWED_server/data/models/datacache.py
2025-04-30 16:57:46 +08:00

33 lines
834 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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}')>"