38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
from abc import ABC, abstractmethod
|
|
|
|
from konabot.common.longtask import LongTaskTarget
|
|
from konabot.common.pager import PagerQuery, PagerResult
|
|
|
|
|
|
class IPosterRepo(ABC):
|
|
@abstractmethod
|
|
async def get_channel_targets(self, channel: str) -> list[LongTaskTarget]:
|
|
"""
|
|
获取广播通道的所有广播对象
|
|
"""
|
|
|
|
@abstractmethod
|
|
async def add_channel_target(self, channel: str, target: LongTaskTarget) -> bool:
|
|
"""
|
|
向广播通道添加一个广播目标。若目标已存在,则返回 False
|
|
"""
|
|
|
|
@abstractmethod
|
|
async def remove_channel_target(self, channel: str, target: LongTaskTarget) -> bool:
|
|
"""
|
|
移除一个广播通道的目标。若目标不存在,则返回 False
|
|
"""
|
|
|
|
@abstractmethod
|
|
async def get_subscribed_channels(self, target: LongTaskTarget, pager: PagerQuery) -> PagerResult[str]:
|
|
"""
|
|
获得一个目标已经订阅了的广播通道
|
|
"""
|
|
|
|
@abstractmethod
|
|
async def merge_channel(self, from_channel: str, to_channel: str) -> None:
|
|
"""
|
|
合并两个 Channel 为一个,并移除另一个
|
|
"""
|
|
|