# -*- coding: utf-8 -*-
from __future__ import annotations

from hotpocket_backend.apps.bot.conf import bot_settings
from hotpocket_backend.apps.bot.types import PStrategy
from hotpocket_soa.dto import BotResultOut


class BotService:
    def is_netloc_banned(self, *, url: str) -> bool:
        strategy: PStrategy = bot_settings.get_strategy(url=url)
        return strategy.is_netloc_banned()

    def handle(self, *, url: str) -> BotResultOut:
        strategy: PStrategy = bot_settings.get_strategy(url=url)
        return strategy.run()
