30 lines
1011 B
Python
30 lines
1011 B
Python
|
|
from app import app
|
|||
|
|
from extensions import db
|
|||
|
|
from models import SystemNotification
|
|||
|
|
|
|||
|
|
def init_notifications():
|
|||
|
|
with app.app_context():
|
|||
|
|
# 检查是否已存在通知
|
|||
|
|
if SystemNotification.query.first():
|
|||
|
|
print("📅 通知系统已初始化,跳过。")
|
|||
|
|
return
|
|||
|
|
|
|||
|
|
# 创建欢迎通知
|
|||
|
|
welcome_notif = SystemNotification(
|
|||
|
|
title="✨ 欢迎使用 AI 视界 2.0",
|
|||
|
|
content="""感谢您体验我们的 AI 创作平台!
|
|||
|
|
|
|||
|
|
1. 我们已上线“优质渲染模式”,支持更精细的画面细节。
|
|||
|
|
2. 积分充值功能正在最后联调中,敬请期待。
|
|||
|
|
3. 提示词区域现已支持自动折叠,界面更简洁。
|
|||
|
|
|
|||
|
|
如果您有任何建议,欢迎通过系统审计日志联系管理员。""",
|
|||
|
|
is_active=True
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
db.session.add(welcome_notif)
|
|||
|
|
db.session.commit()
|
|||
|
|
print("✅ 系统欢迎通知已发布!")
|
|||
|
|
|
|||
|
|
if __name__ == "__main__":
|
|||
|
|
init_notifications()
|