feat✨: 新增Web UI功能及数据库、日志等API接口

This commit is contained in:
HibiKier
2024-07-31 04:58:29 +08:00
parent f0b05ec5ed
commit 2bf5fd1a37
28 changed files with 2643 additions and 18 deletions
+36
View File
@@ -0,0 +1,36 @@
import nonebot
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from strenum import StrEnum
app = nonebot.get_app()
origins = ["*"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
AVA_URL = "http://q1.qlogo.cn/g?b=qq&nk={}&s=160"
GROUP_AVA_URL = "http://p.qlogo.cn/gh/{}/{}/640/"
class QueryDateType(StrEnum):
"""
查询日期类型
"""
DAY = "day"
"""日"""
WEEK = "week"
"""周"""
MONTH = "month"
"""月"""
YEAR = "year"
"""年"""