添加 cookiegame 服务的初始化过程

This commit is contained in:
洛水居室 2022-07-31 15:33:56 +08:00
parent 20726081f4
commit 9c2991e137
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,11 @@
from app.cookies.repositories import CookiesRepository
from app.cookies.service import CookiesService
from utils.app.manager import listener_service
from utils.mysql import MySQL
@listener_service()
def create_cookie_service(mysql: MySQL):
_repository = CookiesRepository(mysql)
_service = CookiesService(_repository, _cache)
return _service

View File

@ -0,0 +1,11 @@
from app.game.cache import GameStrategyCache
from app.game.service import GameStrategyService
from utils.app.manager import listener_service
from utils.redisdb import RedisDB
@listener_service()
def create_game_strategy_service(redis: RedisDB):
_cache = GameStrategyCache(redis)
_service = GameStrategyService(_cache)
return _service