mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 18:04:10 +00:00
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
from service.admin import AdminService
|
|
from service.cache import RedisCache
|
|
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
|
|
from service.wiki import Wiki
|
|
from utils.aiobrowser import AioBrowser
|
|
from utils.mysql import MySQL
|
|
from utils.redisdb import RedisDB
|
|
|
|
|
|
class BaseService:
|
|
"""
|
|
基础服务初始化
|
|
"""
|
|
def __init__(self, mysql: MySQL, redis: RedisDB, browser: AioBrowser):
|
|
self.repository = AsyncRepository(mysql)
|
|
self.cache = RedisCache(redis)
|
|
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)
|
|
self.template = TemplateService(browser)
|
|
self.wiki = Wiki(redis)
|
|
|
|
|
|
class StartService(BaseService):
|
|
pass
|