mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-07 12:50:03 +08:00
feat✨: 新增Web UI功能及数据库、日志等API接口
This commit is contained in:
@@ -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"
|
||||
"""年"""
|
||||
Reference in New Issue
Block a user