2022-04-14 07:18:45 +00:00
|
|
|
from service.admin import AdminService
|
2022-06-09 07:12:06 +00:00
|
|
|
from service.cache import RedisCache
|
2022-04-14 07:18:45 +00:00
|
|
|
from service.gacha import GachaService
|
|
|
|
from service.game import GetGameInfo
|
|
|
|
from service.quiz import QuizService
|
|
|
|
from service.repository import AsyncRepository
|
|
|
|
from service.template import TemplateService
|
|
|
|
from service.user import UserInfoFormDB
|
2022-06-15 11:52:36 +00:00
|
|
|
from service.wiki import Wiki
|
2022-06-09 12:04:38 +00:00
|
|
|
from utils.aiobrowser import AioBrowser
|
|
|
|
from utils.mysql import MySQL
|
|
|
|
from utils.redisdb import RedisDB
|
2022-04-14 07:18:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
class BaseService:
|
2022-06-09 12:52:59 +00:00
|
|
|
"""
|
|
|
|
基础服务初始化
|
|
|
|
"""
|
2022-06-09 12:04:38 +00:00
|
|
|
def __init__(self, mysql: MySQL, redis: RedisDB, browser: AioBrowser):
|
|
|
|
self.repository = AsyncRepository(mysql)
|
|
|
|
self.cache = RedisCache(redis)
|
2022-04-14 07:18:45 +00:00
|
|
|
self.user_service_db = UserInfoFormDB(self.repository)
|
|
|
|
self.quiz_service = QuizService(self.repository, self.cache)
|
|
|
|
self.get_game_info = GetGameInfo(self.repository, self.cache)
|
|
|
|
self.gacha = GachaService(self.repository, self.cache)
|
|
|
|
self.admin = AdminService(self.repository, self.cache)
|
2022-06-09 12:04:38 +00:00
|
|
|
self.template = TemplateService(browser)
|
2022-06-15 11:52:36 +00:00
|
|
|
self.wiki = Wiki(redis)
|
2022-04-14 07:18:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
class StartService(BaseService):
|
2022-06-09 12:08:34 +00:00
|
|
|
pass
|