from fastapi import APIRouter

from app.core.commercial import CommercialFeatureError

router = APIRouter()


def _commercial_only() -> None:
    raise CommercialFeatureError(
        code=6101,
        message="该站点暂不支持此功能（活动中心仅 Go 商业版提供）",
    )


@router.api_route("/activities", methods=["GET", "POST", "PUT", "PATCH", "DELETE"])
def activities_commercial_only() -> None:
    _commercial_only()


@router.api_route("/activities/{activity_id}", methods=["GET", "POST", "PUT", "PATCH", "DELETE"])
def activity_detail_commercial_only(activity_id: int) -> None:
    del activity_id
    _commercial_only()


@router.api_route("/admin/activities", methods=["GET", "POST", "PUT", "PATCH", "DELETE"])
def admin_activities_commercial_only() -> None:
    _commercial_only()


@router.api_route("/admin/activities/{activity_id}", methods=["GET", "POST", "PUT", "PATCH", "DELETE"])
def admin_activity_detail_commercial_only(activity_id: int) -> None:
    del activity_id
    _commercial_only()
