@@ -232,7 +232,7 @@ deploy.bat --mode full --build
232232docker build -t ai-quiz-system .
233233
234234# 运行容器(简单部署)
235- docker run -p 8000:8000 -v $( pwd) /config.yaml:/app/config.yaml ai-quiz-system
235+ docker run -p 8081:8081 -v $( pwd) /config.yaml:/app/config.yaml ai-quiz-system
236236
237237# 使用Docker Compose(推荐)
238238docker-compose up -d
@@ -247,11 +247,11 @@ docker-compose up -d
247247==================================================
248248👤 作者: Toni Wang
249249📧 邮箱: shell7@petalmail.com
250- 🌐 地址: http://0.0.0.0:8000
250+ 🌐 地址: http://0.0.0.0:8081
251251==================================================
252252```
253253
254- 访问 http://localhost:8000 查看API文档
254+ 访问 http://localhost:8081 查看API文档
255255
256256## 🐳 Docker部署
257257
@@ -283,7 +283,7 @@ graph TB
283283# 应用基础配置
284284APP_NAME=AI智能题库查询系统
285285SERVER_HOST=0.0.0.0
286- SERVER_PORT=8000
286+ SERVER_PORT=8081
287287
288288# 数据库配置
289289DATABASE_URL=sqlite:///./data/app.db
@@ -310,7 +310,7 @@ services:
310310 ai-wenda :
311311 build : .
312312 ports :
313- - " 8000:8000 "
313+ - " 8081:8081 "
314314 environment :
315315 - PYTHONPATH=/app
316316 volumes :
@@ -360,8 +360,8 @@ volumes:
360360
361361| 服务 | 开发模式 | 生产模式 | 完整模式 |
362362|------|----------|----------|----------|
363- | **API服务** | http://localhost:8000 | http://localhost | http://localhost |
364- | **API文档** | http://localhost:8000 /docs | http://localhost/docs | http://localhost/docs |
363+ | **API服务** | http://localhost:8081 | http://localhost | http://localhost |
364+ | **API文档** | http://localhost:8081 /docs | http://localhost/docs | http://localhost/docs |
365365| **Redis** | localhost:6379 | localhost:6379 | localhost:6379 |
366366| **监控面板** | - | - | http://localhost:9090 |
367367
@@ -376,7 +376,7 @@ volumes:
376376#### 健康检查
377377` ` ` bash
378378# 检查服务状态
379- curl http://localhost:8000 /api/health
379+ curl http://localhost:8081 /api/health
380380
381381# 查看容器状态
382382docker-compose ps
@@ -465,7 +465,7 @@ docker-compose build --no-cache
465465``` bash
466466# 修改docker-compose.yml中的端口映射
467467ports:
468- - " 8001:8000 " # 改为其他端口
468+ - " 8002:8081 " # 改为其他端口
469469```
470470
4714713 . ** 权限问题**
@@ -511,10 +511,10 @@ sudo chown -R 1000:1000 ./data
511511** 请求示例:**
512512``` bash
513513# GET请求
514- curl " http://localhost:8000 /api/query?title=中国的首都是哪里?&options=A.北京 B.上海 C.广州&type=选择题"
514+ curl " http://localhost:8081 /api/query?title=中国的首都是哪里?&options=A.北京 B.上海 C.广州&type=选择题"
515515
516516# POST请求
517- curl -X POST http://localhost:8000 /api/query \
517+ curl -X POST http://localhost:8081 /api/query \
518518 -H " Content-Type: application/json" \
519519 -d ' {
520520 "title": "1+1等于多少?",
@@ -610,12 +610,12 @@ curl -X POST http://localhost:8000/api/query \
610610
611611启动服务后,访问以下地址查看完整API文档:
612612
613- - ** 📘 Swagger UI** : http://localhost:8000 /docs
613+ - ** 📘 Swagger UI** : http://localhost:8081 /docs
614614 - 支持在线测试API
615615 - 详细的请求/响应示例
616616 - 参数说明和约束
617617
618- - ** 📗 ReDoc** : http://localhost:8000 /redoc
618+ - ** 📗 ReDoc** : http://localhost:8081 /redoc
619619 - 美观的三栏式文档
620620 - 适合打印和分享
621621 - 完整的API规范
@@ -625,7 +625,7 @@ curl -X POST http://localhost:8000/api/query \
625625#### 批量查询
626626``` bash
627627# 使用POST进行批量查询
628- curl -X POST http://localhost:8000 /api/query/batch \
628+ curl -X POST http://localhost:8081 /api/query/batch \
629629 -H " Content-Type: application/json" \
630630 -d ' {
631631 "questions": [
@@ -638,7 +638,7 @@ curl -X POST http://localhost:8000/api/query/batch \
638638#### 指定AI提供商
639639``` bash
640640# 临时指定使用的AI平台
641- curl " http://localhost:8000 /api/query?title=编程问题&provider=deepseek"
641+ curl " http://localhost:8081 /api/query?title=编程问题&provider=deepseek"
642642```
643643
644644## 🔧 配置说明
@@ -648,7 +648,7 @@ curl "http://localhost:8000/api/query?title=编程问题&provider=deepseek"
648648``` yaml
649649server :
650650 host : " 0.0.0.0" # 服务器地址
651- port : 8000 # 服务器端口
651+ port : 8081 # 服务器端口
652652 reload : false # 是否开启热重载
653653` ` `
654654
@@ -687,13 +687,13 @@ python test_app.py
687687
688688``` bash
689689# 测试查询接口
690- curl " http://localhost:8000 /api/query?title=1+1等于多少?&type=填空题"
690+ curl " http://localhost:8081 /api/query?title=1+1等于多少?&type=填空题"
691691
692692# 测试健康检查
693- curl " http://localhost:8000 /api/health"
693+ curl " http://localhost:8081 /api/health"
694694
695695# 测试系统信息
696- curl " http://localhost:8000 /api/system/info"
696+ curl " http://localhost:8081 /api/system/info"
697697```
698698
699699## 🏗️ 项目结构
@@ -757,8 +757,8 @@ project/
757757** 问题1:端口被占用**
758758``` bash
759759# 查找占用端口的进程
760- netstat -ano | findstr :8000 # Windows
761- lsof -i :8000 # macOS/Linux
760+ netstat -ano | findstr :8081 # Windows
761+ lsof -i :8081 # macOS/Linux
762762
763763# 杀死进程或修改配置文件中的端口
764764```
@@ -854,10 +854,10 @@ logging:
854854tail -f app.log
855855
856856# 检查系统状态
857- curl http://localhost:8000 /api/health
857+ curl http://localhost:8081 /api/health
858858
859859# 测试AI提供商状态
860- curl http://localhost:8000 /api/ai-providers
860+ curl http://localhost:8081 /api/ai-providers
861861```
862862
863863### 获取帮助
0 commit comments