From 9c05a29aa408837775cb0678bfbddff5e9116ead Mon Sep 17 00:00:00 2001 From: xianyaowen <2311651249@qq.com> Date: Mon, 21 Sep 2026 17:13:31 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=87=B3=E3=80=8C/=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..3b5aa26 --- /dev/null +++ b/main.py @@ -0,0 +1,38 @@ +from fastapi import FastAPI +import uvicorn +from starlette.middleware.cors import CORSMiddleware +from tortoise.contrib.fastapi import register_tortoise + +from api import api_router +from common.exception_handler import setup_exceptions + +from common.result import Result +from settings import TORTOISE_ORM + +app = FastAPI() + +# 跨域配置 CORS +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], # 允许所有源 + allow_methods=["*"], # 允许所有 HTTP 方法 + allow_headers=["*"], # 允许所有请求头 +) + + +# 配置路由 +app.include_router(api_router) +# 注册orm +register_tortoise(app, config=TORTOISE_ORM, add_exception_handlers=True, generate_schemas=True) +# 注册异常处理器 +setup_exceptions(app) + + +@app.get("/") +async def root(): + return Result.success() + + +if __name__ == "__main__": + uvicorn.run("main:app", host='0.0.0.0',reload=True, port=9090) + -- 2.54.0 From 8bd0bdf61586a13cb00ee3dc7d3058d463ba46aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=80=E6=96=87=E7=91=9E?= <17608442+jianwenrui@user.noreply.gitee.com> Date: Mon, 21 Sep 2026 19:45:54 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E7=AE=80=E7=9A=84=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jian_commit.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 jian_commit.txt diff --git a/jian_commit.txt b/jian_commit.txt new file mode 100644 index 0000000..dd61377 --- /dev/null +++ b/jian_commit.txt @@ -0,0 +1 @@ +提交提交提交 \ No newline at end of file -- 2.54.0 From b78d6264af41030618637b3455d2bb5eb9896c23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E7=A2=A7=E8=95=BE?= <17608254+sunbilei@user.noreply.gitee.com> Date: Mon, 21 Sep 2026 19:47:09 +0800 Subject: [PATCH 3/6] 111 --- sbl.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 sbl.txt diff --git a/sbl.txt b/sbl.txt new file mode 100644 index 0000000..a804973 --- /dev/null +++ b/sbl.txt @@ -0,0 +1 @@ +gjgdgdg \ No newline at end of file -- 2.54.0 From 456375bc91c99e159f9d255e1363ef259fbfb995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=80=E6=96=87=E7=91=9E?= <17608442+jianwenrui@user.noreply.gitee.com> Date: Mon, 21 Sep 2026 19:56:55 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=AF=A5=E6=96=87=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BA=86=E7=AC=AC=E4=B8=80=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements_1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_1.txt b/requirements_1.txt index 6b7c026..c496d85 100644 --- a/requirements_1.txt +++ b/requirements_1.txt @@ -1,4 +1,4 @@ -# FastAPI 核心框架(保留你指定的版本) +# FastAPI 核心框架(保留你指定的版本) %简文瑞埋下的一个冲突 fastapi~=0.124.2 # ASGI 服务器(带standard扩展,适配最新版) uvicorn[standard]~=0.38.0 -- 2.54.0 From f43cd76a6db3154aece417070787300a103c6339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=80=E6=96=87=E7=91=9E?= <17608442+jianwenrui@user.noreply.gitee.com> Date: Mon, 21 Sep 2026 20:05:34 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sbl.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbl.txt b/sbl.txt index a804973..137a0a1 100644 --- a/sbl.txt +++ b/sbl.txt @@ -1 +1 @@ -gjgdgdg \ No newline at end of file +我改了 \ No newline at end of file -- 2.54.0 From 725496182532789b21c5da531afb9d79dd076ee7 Mon Sep 17 00:00:00 2001 From: liuxing <2728607551@qq.com> Date: Mon, 21 Sep 2026 20:29:01 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20sbl.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sbl.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbl.txt b/sbl.txt index 137a0a1..8fbb53e 100644 --- a/sbl.txt +++ b/sbl.txt @@ -1 +1,2 @@ -我改了 \ No newline at end of file +我改了 +我又改了---liux \ No newline at end of file -- 2.54.0