Go to file
公司git 7172f3ab04 ```
feat(config): 添加代理超时配置选项

添加了多种场景的代理超时配置:
- 默认超时:60秒
- 短任务超时:30秒(轮询、小图片下载)
- 长任务超时:300秒(视频下载、大文件)
- 生成任务超时:600秒(AI生成请求)

refactor(services): 统一使用配置化的代理超时参数

将硬编码的超时值替换为配置文件中的常量:
- 文件服务使用默认超时
- 聊天生成功能使用长任务超时
- 图片下载使用短任务超时
- 视频生成功能使用相应的默认、短、长超时配置
```
2026-02-02 17:05:31 +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 ``` 2026-01-23 22:09:45 +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
scripts ``` 2026-01-23 22:09:45 +08:00
services ``` 2026-02-02 17:05:31 +08:00
static ``` 2026-01-23 21:47:01 +08:00
templates ``` 2026-01-23 21:46:08 +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): 在订单处理流程中新增Redis分布式锁机制防止并发问题 2026-01-23 17:55:33 +08:00
config.py ``` 2026-02-02 17:05:31 +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 ``` 2026-01-23 21:46:08 +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
utils.py ``` 2026-02-02 12:54:43 +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)