Go to file
公司git 1196809c6a feat(payment): 添加订单状态同步功能和主动查询接口
- 在 app.py 中集成定时任务,每分钟同步最近30分钟内待支付订单状态
- 定时任务调用支付宝接口更新订单状态及用户积分,记录日志
- payment.py 新增主动查询订单接口,支持用户手动触发订单状态同步
- 添加订单简单查询API,返回订单当前状态信息
- 支付异步通知日志记录优化,改为系统日志记录
- 配置文件中调整支付宝回调地址使用 HTTPS 协议
- alipay_service.py 增加支付宝订单状态查询方法,支持主动轮询订单状态
2026-01-23 17:40:23 +08:00
.agent/workflows feat: Initialize UI/UX Pro Max agent with core data, stack definitions, and utility scripts. 2026-01-18 20:35:35 +08:00
.shared/ui-ux-pro-max feat: Initialize UI/UX Pro Max agent with core data, stack definitions, and utility scripts. 2026-01-18 20:35:35 +08:00
blueprints feat(payment): 添加订单状态同步功能和主动查询接口 2026-01-23 17:40:23 +08:00
middlewares feat: Implement core application structure with new services, blueprints, templates, and database migrations. 2026-01-17 23:15:58 +08:00
migrations feat: Implement core application structure with new services, blueprints, templates, and database migrations. 2026-01-17 23:15:58 +08:00
services feat(payment): 添加订单状态同步功能和主动查询接口 2026-01-23 17:40:23 +08:00
static feat: Implement a new API blueprint for core application functionalities including generation, history, notifications, user stats, and saved prompts, along with a new SavedPrompt model and supporting frontend. 2026-01-21 20:43:46 +08:00
templates feat: Implement a new API blueprint for core application functionalities including generation, history, notifications, user stats, and saved prompts, along with a new SavedPrompt model and supporting frontend. 2026-01-21 20:43:46 +08:00
.gitignore feat: Implement a comprehensive user authentication system, add video generation capabilities, and set up database migrations and API blueprints. 2026-01-16 22:24:14 +08:00
app.py feat(payment): 添加订单状态同步功能和主动查询接口 2026-01-23 17:40:23 +08:00
config.py feat(payment): 添加订单状态同步功能和主动查询接口 2026-01-23 17:40:23 +08:00
db_manager.py feat: Implement core application structure with new services, blueprints, templates, and database migrations. 2026-01-17 23:15:58 +08:00
extensions.py feat: Implement a comprehensive user authentication system, add video generation capabilities, and set up database migrations and API blueprints. 2026-01-16 22:24:14 +08:00
models.py feat: Implement a new API blueprint for core application functionalities including generation, history, notifications, user stats, and saved prompts, along with a new SavedPrompt model and supporting frontend. 2026-01-21 20:43:46 +08:00
README.md feat: implement core API and generation services for AI image, video, and chat functionalities, user history, and point management. 2026-01-20 09:29:01 +08:00
requirements.txt feat: Implement a comprehensive user authentication system, add video generation capabilities, and set up database migrations and API blueprints. 2026-01-16 22:24:14 +08:00

AI 视界 (AI Vision) 项目指南

🚀 快速开始

1. 环境准备

确保已安装 Python 3.8+ 和 PostgreSQL / Redis。

创建虚拟环境

# 如果 python 命令不可用,请尝试使用 py
python -m venv .venv
# 或者
py -m venv .venv

激活虚拟环境 (推荐)

# Windows (PowerShell)
.\.venv\Scripts\Activate.ps1

# Linux / Mac
source .venv/bin/activate

安装依赖

pip install -r requirements.txt

2. 启动服务

python app.py

服务默认运行在 http://127.0.0.1:5000


🛠️ 常用维护命令

数据库管理 (推荐)

本项目内置了自动化数据库管理工具 db_manager.py,用于处理模型变更和迁移。

一键自动同步 (最常用) 当您修改了 models.py 中的表结构后,运行此命令自动完成迁移:

python db_manager.py sync

分步操作 如果您需要更精细的控制:

  • 初始化环境 (仅首次): python db_manager.py init
  • 生成迁移脚本: python db_manager.py make "修改说明"
  • 执行数据库变更: python db_manager.py up

系统配置更新

AI 模型、提示词模板等配置已移至数据库的 system_dicts 表中。

  • 请登录 Web 后台管理界面 (/rbac) 进行可视化的添加和修改。
  • 或直接操作数据库更新 system_dicts 表。

📂 目录结构说明

  • app.py: 应用入口
  • config.py: 配置文件
  • models.py: 数据库模型定义
  • blueprints/: 路由蓝图 (API 接口)
    • api.py: 核心业务接口 (Controller)
    • admin.py: 后台管理接口
    • auth.py: 认证接口
  • services/: 业务逻辑层 (Service)
    • task_service.py: 异步任务处理 (生图/视频)
    • generation_service.py: 生成请求验证与计费
    • system_service.py: 系统配置与通知
    • history_service.py: 历史记录查询
  • templates/: 前端 HTML 模板
  • static/: 静态资源 (JS/CSS)