fix(*): 将文件导入从绝对路径给为相对路径
This commit is contained in:
0
__init__.py
Normal file
0
__init__.py
Normal file
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
|
||||||
from response import ok
|
from ..response import ok
|
||||||
|
|
||||||
|
|
||||||
async def health_handler(request: web.Request) -> web.Response:
|
async def health_handler(request: web.Request) -> web.Response:
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import asyncio
|
|||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
|
||||||
from config import QQ_API_MAX_RETRIES, QQ_API_TIMEOUT
|
from ..config import QQ_API_MAX_RETRIES, QQ_API_TIMEOUT
|
||||||
from response import error, ok
|
from ..response import error, ok
|
||||||
|
|
||||||
VALID_MSG_TYPES = {"text", "image", "file", "video"}
|
VALID_MSG_TYPES = {"text", "image", "file", "video"}
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
from aiohttp import BodyPartReader, web
|
from aiohttp import BodyPartReader, web
|
||||||
|
|
||||||
from config import ALLOWED_EXTENSIONS, MAX_UPLOAD_SIZE, UPLOAD_DIR
|
from ..config import ALLOWED_EXTENSIONS, MAX_UPLOAD_SIZE, UPLOAD_DIR
|
||||||
from response import error, ok
|
from ..response import error, ok
|
||||||
|
|
||||||
logger = logging.getLogger("webhook-plugin.upload")
|
logger = logging.getLogger("webhook-plugin.upload")
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import uuid
|
|||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
|
||||||
from config import WEBHOOK_API_KEY
|
from .config import WEBHOOK_API_KEY
|
||||||
from response import error
|
from .response import error
|
||||||
|
|
||||||
|
|
||||||
@web.middleware
|
@web.middleware
|
||||||
|
|||||||
10
plugin.py
10
plugin.py
@@ -6,11 +6,11 @@ import logging
|
|||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
from ncatbot.plugin import NcatBotPlugin
|
from ncatbot.plugin import NcatBotPlugin
|
||||||
|
|
||||||
from config import HOST, PORT, UPLOAD_DIR, WEBHOOK_API_KEY
|
from .config import HOST, PORT, UPLOAD_DIR, WEBHOOK_API_KEY
|
||||||
from handlers.health import health_handler
|
from .handlers.health import health_handler
|
||||||
from handlers.message import webhook_handler
|
from .handlers.message import webhook_handler
|
||||||
from handlers.upload import cleanup_expired_files, upload_handler
|
from .handlers.upload import cleanup_expired_files, upload_handler
|
||||||
from middleware import auth_middleware, request_id_middleware
|
from .middleware import auth_middleware, request_id_middleware
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
|
|||||||
Reference in New Issue
Block a user