base.py 763 B

12345678910111213141516171819202122232425
  1. # -*- coding: utf-8 -*-
  2. # !/usr/bin/env python
  3. from typing import Optional, TYPE_CHECKING
  4. from apps.web.core import BaseAppProxy
  5. if TYPE_CHECKING:
  6. from apps.web.core.models import EmbeddedApp, WechatPayApp
  7. class AuthBridge(BaseAppProxy):
  8. def __init__(self, app):
  9. # type: (Optional[EmbeddedApp, WechatPayApp])->None
  10. super(AuthBridge, self).__init__(app)
  11. def __repr__(self):
  12. return '<{}(appid={}, occupant={})>'.format(self.__class__.__name__, self.app.appid, self.occupantId)
  13. def authorize(self, auth_code):
  14. raise NotImplementedError('must implement authorize method')
  15. def get_user_info(self, auth_code):
  16. raise NotImplementedError('must implement get_user_info method')