mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 18:04:10 +00:00
8f424bf0d4
♻️ 重构插件系统 ⚙️ 重写插件 🎨 改进代码结构 📝 完善文档 Co-authored-by: zhxy-CN <admin@owo.cab> Co-authored-by: 洛水居室 <luoshuijs@outlook.com> Co-authored-by: xtaodada <xtao@xtaolink.cn> Co-authored-by: Li Chuangbo <im@chuangbo.li>
22 lines
689 B
Python
22 lines
689 B
Python
from core.base.mysql import MySQL
|
|
from core.base.redisdb import RedisDB
|
|
from core.cookies.cache import PublicCookiesCache
|
|
from core.cookies.repositories import CookiesRepository
|
|
from core.cookies.services import CookiesService, PublicCookiesService
|
|
from core.service import init_service
|
|
|
|
|
|
@init_service
|
|
def create_cookie_service(mysql: MySQL):
|
|
_repository = CookiesRepository(mysql)
|
|
_service = CookiesService(_repository)
|
|
return _service
|
|
|
|
|
|
@init_service
|
|
def create_public_cookie_service(mysql: MySQL, redis: RedisDB):
|
|
_repository = CookiesRepository(mysql)
|
|
_cache = PublicCookiesCache(redis)
|
|
_service = PublicCookiesService(_repository, _cache)
|
|
return _service
|