diff --git a/app_vx.py b/app_vx.py index 5c5f6913..821278d7 100644 --- a/app_vx.py +++ b/app_vx.py @@ -7297,40 +7297,6 @@ def api_user_activities(): }), 500 -class UserFeedback(db.Model): - """用户反馈模型""" - id = db.Column(db.Integer, primary_key=True) - user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) - type = db.Column(db.String(50), nullable=False) # 反馈类型 - content = db.Column(db.Text, nullable=False) # 反馈内容 - contact_info = db.Column(db.String(100)) # 联系方式 - status = db.Column(db.String(20), default='pending') # 状态:pending/processing/resolved/closed - admin_reply = db.Column(db.Text) # 管理员回复 - created_at = db.Column(db.DateTime, default=beijing_now) - updated_at = db.Column(db.DateTime, default=beijing_now, onupdate=beijing_now) - - # 关联关系 - user = db.relationship('User', backref='feedbacks') - - def __init__(self, user_id, type, content, contact_info=None): - self.user_id = user_id - self.type = type - self.content = content - self.contact_info = contact_info - - def to_dict(self): - return { - 'id': self.id, - 'type': self.type, - 'content': self.content, - 'contact_info': self.contact_info, - 'status': self.status, - 'admin_reply': self.admin_reply, - 'created_at': self.created_at.strftime('%Y-%m-%d %H:%M:%S'), - 'updated_at': self.updated_at.strftime('%Y-%m-%d %H:%M:%S') - } - - # 通用错误处理 @app.errorhandler(404) def api_not_found(error):