diff --git a/apps/admin/__init__.py b/core/admin/__init__.py similarity index 100% rename from apps/admin/__init__.py rename to core/admin/__init__.py diff --git a/apps/admin/cache.py b/core/admin/cache.py similarity index 100% rename from apps/admin/cache.py rename to core/admin/cache.py diff --git a/apps/admin/models.py b/core/admin/models.py similarity index 100% rename from apps/admin/models.py rename to core/admin/models.py diff --git a/apps/admin/repositories.py b/core/admin/repositories.py similarity index 100% rename from apps/admin/repositories.py rename to core/admin/repositories.py diff --git a/apps/admin/services.py b/core/admin/services.py similarity index 100% rename from apps/admin/services.py rename to core/admin/services.py diff --git a/apps/cookies/__init__.py b/core/cookies/__init__.py similarity index 100% rename from apps/cookies/__init__.py rename to core/cookies/__init__.py diff --git a/apps/cookies/cache.py b/core/cookies/cache.py similarity index 100% rename from apps/cookies/cache.py rename to core/cookies/cache.py diff --git a/apps/cookies/error.py b/core/cookies/error.py similarity index 100% rename from apps/cookies/error.py rename to core/cookies/error.py diff --git a/apps/cookies/models.py b/core/cookies/models.py similarity index 100% rename from apps/cookies/models.py rename to core/cookies/models.py diff --git a/apps/cookies/repositories.py b/core/cookies/repositories.py similarity index 100% rename from apps/cookies/repositories.py rename to core/cookies/repositories.py diff --git a/apps/cookies/services.py b/core/cookies/services.py similarity index 100% rename from apps/cookies/services.py rename to core/cookies/services.py diff --git a/apps/game/__init__.py b/core/game/__init__.py similarity index 100% rename from apps/game/__init__.py rename to core/game/__init__.py diff --git a/apps/game/cache.py b/core/game/cache.py similarity index 100% rename from apps/game/cache.py rename to core/game/cache.py diff --git a/apps/game/services.py b/core/game/services.py similarity index 100% rename from apps/game/services.py rename to core/game/services.py diff --git a/apps/quiz/__init__.py b/core/quiz/__init__.py similarity index 100% rename from apps/quiz/__init__.py rename to core/quiz/__init__.py diff --git a/apps/quiz/base.py b/core/quiz/base.py similarity index 100% rename from apps/quiz/base.py rename to core/quiz/base.py diff --git a/apps/quiz/cache.py b/core/quiz/cache.py similarity index 100% rename from apps/quiz/cache.py rename to core/quiz/cache.py diff --git a/apps/quiz/models.py b/core/quiz/models.py similarity index 100% rename from apps/quiz/models.py rename to core/quiz/models.py diff --git a/apps/quiz/repositories.py b/core/quiz/repositories.py similarity index 100% rename from apps/quiz/repositories.py rename to core/quiz/repositories.py diff --git a/apps/quiz/services.py b/core/quiz/services.py similarity index 100% rename from apps/quiz/services.py rename to core/quiz/services.py diff --git a/apps/sign/__init__.py b/core/sign/__init__.py similarity index 100% rename from apps/sign/__init__.py rename to core/sign/__init__.py diff --git a/apps/sign/models.py b/core/sign/models.py similarity index 100% rename from apps/sign/models.py rename to core/sign/models.py diff --git a/apps/sign/repositories.py b/core/sign/repositories.py similarity index 100% rename from apps/sign/repositories.py rename to core/sign/repositories.py diff --git a/apps/sign/services.py b/core/sign/services.py similarity index 100% rename from apps/sign/services.py rename to core/sign/services.py diff --git a/apps/template/__init__.py b/core/template/__init__.py similarity index 100% rename from apps/template/__init__.py rename to core/template/__init__.py diff --git a/apps/template/services.py b/core/template/services.py similarity index 100% rename from apps/template/services.py rename to core/template/services.py diff --git a/apps/user/__init__.py b/core/user/__init__.py similarity index 100% rename from apps/user/__init__.py rename to core/user/__init__.py diff --git a/apps/user/models.py b/core/user/models.py similarity index 100% rename from apps/user/models.py rename to core/user/models.py diff --git a/apps/user/repositories.py b/core/user/repositories.py similarity index 100% rename from apps/user/repositories.py rename to core/user/repositories.py diff --git a/apps/user/services.py b/core/user/services.py similarity index 100% rename from apps/user/services.py rename to core/user/services.py diff --git a/apps/wiki/__init__.py b/core/wiki/__init__.py similarity index 100% rename from apps/wiki/__init__.py rename to core/wiki/__init__.py diff --git a/apps/wiki/cache.py b/core/wiki/cache.py similarity index 100% rename from apps/wiki/cache.py rename to core/wiki/cache.py diff --git a/apps/wiki/services.py b/core/wiki/services.py similarity index 100% rename from apps/wiki/services.py rename to core/wiki/services.py diff --git a/jobs/public_cookies.py b/jobs/public_cookies.py index e614230e..8c4f4167 100644 --- a/jobs/public_cookies.py +++ b/jobs/public_cookies.py @@ -2,7 +2,7 @@ import datetime from telegram.ext import CallbackContext, JobQueue -from apps.cookies.services import PublicCookiesService +from core.cookies.services import PublicCookiesService from logger import Log from utils.job.manager import listener_jobs_class from utils.service.inject import inject diff --git a/jobs/sign.py b/jobs/sign.py index dfabe233..21ad1488 100644 --- a/jobs/sign.py +++ b/jobs/sign.py @@ -7,11 +7,11 @@ from telegram.constants import ParseMode from telegram.error import BadRequest, Forbidden from telegram.ext import CallbackContext, JobQueue -from apps.cookies import CookiesService -from apps.sign.models import SignStatusEnum -from apps.sign.services import SignServices -from apps.user import UserService from config import config +from core.cookies import CookiesService +from core.sign.models import SignStatusEnum +from core.sign.services import SignServices +from core.user import UserService from logger import Log from utils.helpers import get_genshin_client from utils.job.manager import listener_jobs_class diff --git a/main.py b/main.py index 27e23c73..73f44e9f 100644 --- a/main.py +++ b/main.py @@ -38,7 +38,7 @@ def main() -> None: # 传入服务并启动 Log.info("正在启动服务") services = ServicesManager(mysql, redis, browser) - services.refresh_list("./apps/*") + services.refresh_list("./core/*") services.import_module() services.add_service() diff --git a/plugins/abyss.py b/plugins/abyss.py index 903185c8..f2c35b40 100644 --- a/plugins/abyss.py +++ b/plugins/abyss.py @@ -3,10 +3,10 @@ from telegram import Update from telegram.constants import ChatAction from telegram.ext import CommandHandler, MessageHandler, filters, CallbackContext -from apps.cookies.services import CookiesService -from apps.template.services import TemplateService -from apps.user import UserService -from apps.user.repositories import UserNotFoundError +from core.cookies.services import CookiesService +from core.template.services import TemplateService +from core.user import UserService +from core.user.repositories import UserNotFoundError from logger import Log from plugins.base import BasePlugins from utils.decorators.error import error_callable diff --git a/plugins/adduser.py b/plugins/adduser.py index 0ff57fe9..a780745c 100644 --- a/plugins/adduser.py +++ b/plugins/adduser.py @@ -7,10 +7,10 @@ from telegram import Update, ReplyKeyboardRemove, ReplyKeyboardMarkup, TelegramO from telegram.ext import CallbackContext, CommandHandler, MessageHandler, filters, ConversationHandler from telegram.helpers import escape_markdown -from apps.cookies.services import CookiesService -from apps.user.models import User -from apps.user.repositories import UserNotFoundError -from apps.user.services import UserService +from core.cookies.services import CookiesService +from core.user.models import User +from core.user.repositories import UserNotFoundError +from core.user.services import UserService from logger import Log from models.base import RegionEnum from plugins.base import BasePlugins diff --git a/plugins/admin.py b/plugins/admin.py index 19fbe69e..1b2c5a57 100644 --- a/plugins/admin.py +++ b/plugins/admin.py @@ -2,7 +2,7 @@ from telegram import Update from telegram.error import BadRequest, Forbidden from telegram.ext import CallbackContext, CommandHandler -from apps.admin import BotAdminService +from core.admin import BotAdminService from logger import Log from utils.decorators.admins import bot_admins_rights_check from utils.plugins.manager import listener_plugins_class diff --git a/plugins/base.py b/plugins/base.py index 75bec7e3..c86f24d4 100644 --- a/plugins/base.py +++ b/plugins/base.py @@ -4,7 +4,7 @@ from telegram import Update, ReplyKeyboardRemove from telegram.error import BadRequest from telegram.ext import CallbackContext, ConversationHandler, filters -from apps.admin.services import BotAdminService +from core.admin.services import BotAdminService from logger import Log from utils.service.inject import inject diff --git a/plugins/daily_note.py b/plugins/daily_note.py index 999ab7a7..668262c4 100644 --- a/plugins/daily_note.py +++ b/plugins/daily_note.py @@ -8,10 +8,10 @@ from telegram.constants import ChatAction from telegram.ext import CommandHandler, MessageHandler, ConversationHandler, filters, \ CallbackContext -from apps.cookies.services import CookiesService -from apps.template.services import TemplateService -from apps.user.repositories import UserNotFoundError -from apps.user.services import UserService +from core.cookies.services import CookiesService +from core.template.services import TemplateService +from core.user.repositories import UserNotFoundError +from core.user.services import UserService from logger import Log from plugins.base import BasePlugins from utils.decorators.error import error_callable diff --git a/plugins/gacha/gacha.py b/plugins/gacha/gacha.py index 18a54008..ff9d8e9e 100644 --- a/plugins/gacha/gacha.py +++ b/plugins/gacha/gacha.py @@ -5,7 +5,7 @@ from telegram import Update from telegram.constants import ChatAction from telegram.ext import filters, CommandHandler, MessageHandler, CallbackContext -from apps.template import TemplateService +from core.template import TemplateService from logger import Log from models.apihelper.gacha import GachaInfo from plugins.base import BasePlugins diff --git a/plugins/help.py b/plugins/help.py index 243d1225..797ed949 100644 --- a/plugins/help.py +++ b/plugins/help.py @@ -3,8 +3,8 @@ from telegram.constants import ChatAction from telegram.error import BadRequest from telegram.ext import CommandHandler, CallbackContext -from apps.template.services import TemplateService from config import config +from core.template.services import TemplateService from logger import Log from utils.decorators.error import error_callable from utils.decorators.restricts import restricts diff --git a/plugins/inline.py b/plugins/inline.py index a42d1196..6c5898bc 100644 --- a/plugins/inline.py +++ b/plugins/inline.py @@ -6,7 +6,7 @@ from telegram.constants import ParseMode from telegram.error import BadRequest from telegram.ext import CallbackContext -from apps.wiki import WikiService +from core.wiki import WikiService from logger import Log from utils.service.inject import inject diff --git a/plugins/ledger.py b/plugins/ledger.py index 6821cc95..45f85067 100644 --- a/plugins/ledger.py +++ b/plugins/ledger.py @@ -8,10 +8,10 @@ from telegram import Update from telegram.constants import ChatAction from telegram.ext import CallbackContext, CommandHandler, MessageHandler, ConversationHandler, filters -from apps.cookies.services import CookiesService -from apps.template.services import TemplateService -from apps.user.repositories import UserNotFoundError -from apps.user.services import UserService +from core.cookies.services import CookiesService +from core.template.services import TemplateService +from core.user.repositories import UserNotFoundError +from core.user.services import UserService from logger import Log from plugins.base import BasePlugins from utils.bot import get_all_args diff --git a/plugins/sign.py b/plugins/sign.py index 76519e79..7c19791c 100644 --- a/plugins/sign.py +++ b/plugins/sign.py @@ -5,11 +5,11 @@ from genshin import Game, GenshinException, AlreadyClaimed, Client from telegram import Update from telegram.ext import CommandHandler, MessageHandler, ConversationHandler, filters, CallbackContext -from apps.cookies.services import CookiesService -from apps.sign.models import Sign as SignUser, SignStatusEnum -from apps.sign.services import SignServices -from apps.user.repositories import UserNotFoundError -from apps.user.services import UserService +from core.cookies.services import CookiesService +from core.sign.models import Sign as SignUser, SignStatusEnum +from core.sign.services import SignServices +from core.user.repositories import UserNotFoundError +from core.user.services import UserService from logger import Log from plugins.base import BasePlugins from utils.bot import get_all_args diff --git a/plugins/strategy.py b/plugins/strategy.py index c1031884..d4fe43e4 100644 --- a/plugins/strategy.py +++ b/plugins/strategy.py @@ -2,7 +2,7 @@ from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup from telegram.constants import ChatAction, ParseMode from telegram.ext import filters, ConversationHandler, CommandHandler, MessageHandler, CallbackContext -from apps.game.services import GameStrategyService +from core.game.services import GameStrategyService from logger import Log from plugins.base import BasePlugins from utils.bot import get_all_args diff --git a/plugins/uid.py b/plugins/uid.py index 071e3bfc..cdd43bdc 100644 --- a/plugins/uid.py +++ b/plugins/uid.py @@ -7,10 +7,10 @@ from telegram import Update from telegram.constants import ChatAction from telegram.ext import CallbackContext, CommandHandler, MessageHandler, ConversationHandler, filters -from apps.cookies.services import CookiesService -from apps.template.services import TemplateService -from apps.user.repositories import UserNotFoundError -from apps.user.services import UserService +from core.cookies.services import CookiesService +from core.template.services import TemplateService +from core.user.repositories import UserNotFoundError +from core.user.services import UserService from logger import Log from plugins.base import BasePlugins from utils.decorators.error import error_callable diff --git a/plugins/weapon.py b/plugins/weapon.py index e63c1f07..26e0460a 100644 --- a/plugins/weapon.py +++ b/plugins/weapon.py @@ -2,8 +2,8 @@ from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup from telegram.constants import ChatAction from telegram.ext import filters, CommandHandler, MessageHandler, CallbackContext -from apps.template.services import TemplateService -from apps.wiki.services import WikiService +from core.template.services import TemplateService +from core.wiki.services import WikiService from logger import Log from metadata.shortname import weaponToName from plugins.base import BasePlugins diff --git a/plugins/wiki.py b/plugins/wiki.py index e4bebe67..fd46b20e 100644 --- a/plugins/wiki.py +++ b/plugins/wiki.py @@ -1,7 +1,7 @@ from telegram import Update from telegram.ext import CommandHandler, CallbackContext -from apps.wiki.services import WikiService +from core.wiki.services import WikiService from plugins.base import BasePlugins from utils.decorators.admins import bot_admins_rights_check from utils.decorators.error import error_callable diff --git a/utils/decorators/admins.py b/utils/decorators/admins.py index 285c860f..d777fd42 100644 --- a/utils/decorators/admins.py +++ b/utils/decorators/admins.py @@ -1,7 +1,7 @@ from functools import wraps from typing import Callable -from apps.admin.services import BotAdminService +from core.admin.services import BotAdminService from utils.service.inject import inject