from typing import Any, Dict, Optional

from app.utils.douyinRequest import DouyinRequest
from app.models.user_oauth import UserOAuth

class DouyinApi:
    def __init__(self, request: DouyinRequest):
        self.request = request

    async def get_advertiser_list(self, oauth_id: str, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
        if not oauth_id:
            raise RuntimeError('OAuth ID is not set.')

        url = ""
        return await self.request.request_with_token_with_context(
            oauth_id,
            url,
            'GET',
            {'params': params or {}}
        )