V2.0.0-alpha1

This commit is contained in:
2025-04-22 03:22:17 +08:00
parent 2a217c4b8c
commit 39bbc94d07
53 changed files with 5019 additions and 1203 deletions

29
app.py Normal file
View File

@@ -0,0 +1,29 @@
from fastapi import FastAPI
from contextlib import asynccontextmanager
import model.database
# 定义程序参数
APP_NAME: str = 'Findreve'
VERSION: str = '2.0.0'
summary='标记、追踪与找回 —— 就这么简单。'
description='Findreve 是一款强大且直观的解决方案,旨在帮助您管理个人物品,'\
'并确保丢失后能够安全找回。每个物品都会被分配一个 唯一 ID '\
'并生成一个 安全链接 ,可轻松嵌入到 二维码 或 NFC 标签 中。'\
'当扫描该代码时,会将拾得者引导至一个专门的网页,上面显示物品详情和您的联系信息,'\
'既保障隐私又便于沟通。无论您是在管理个人物品还是专业资产,'\
'Findreve 都能以高效、简便的方式弥合丢失与找回之间的距离。'
# Findreve 的生命周期
@asynccontextmanager
async def lifespan(app: FastAPI):
await model.database.Database().init_db()
yield
# 定义 Findreve 服务器
app = FastAPI(
title=APP_NAME,
version=VERSION,
summary=summary,
description=description,
lifespan=lifespan
)