from fastapi import APIRouter

from app.core.commercial import CommercialFeatureError

router = APIRouter()
_MSG = "第三方登录仅 Go 商业版支持，当前站点暂不支持此功能"


def _gate() -> None:
    raise CommercialFeatureError(code=6101, message=_MSG)


@router.api_route("/auth/oauth/providers", methods=["GET"])
def oauth_providers() -> None:
    _gate()


@router.api_route("/auth/oauth/{plugin_id}/url", methods=["GET", "POST"])
def oauth_url(plugin_id: str) -> None:
    del plugin_id
    _gate()


@router.api_route("/auth/oauth/{plugin_id}/callback", methods=["GET", "POST"])
def oauth_callback(plugin_id: str) -> None:
    del plugin_id
    _gate()


@router.api_route("/auth/oauth/{plugin_id}/bind", methods=["POST", "DELETE"])
def oauth_bind(plugin_id: str) -> None:
    del plugin_id
    _gate()


@router.api_route("/users/me/oauth-connections", methods=["GET"])
def oauth_connections() -> None:
    _gate()
