from dataclasses import dataclass, field

from .base import Paysite, Service_Post, Service_User


@dataclass
class User(Service_User):
    def profile(self, artist: dict) -> str:
        return f"https://www.dlsite.com/eng/circle/profile/=/maker_id/{(artist or {}).get('id')}"


@dataclass
class Post(Service_Post):
    def link(self, post_id: str, user_id: str) -> str:
        return f"https://www.dlsite.com/ecchi-eng/work/=/product_id/{post_id}"


@dataclass
class DLSite(Paysite):
    name: str = "dlsite"
    title: str = "DLsite"
    user: User = field(default_factory=User)
    post: Post = field(default_factory=Post)
    color: str = "#052a83"
