diff --git a/apps/authentication/sms_verify_code.py b/apps/authentication/sms_verify_code.py index 4236d9c0d..4fd5c7fa2 100644 --- a/apps/authentication/sms_verify_code.py +++ b/apps/authentication/sms_verify_code.py @@ -3,7 +3,7 @@ import random from django.core.cache import cache from django.utils.translation import gettext_lazy as _ -from common.message.backends.sms import SMS +from common.sdk.im.sms import SMS from common.utils import get_logger from common.exceptions import JMSException diff --git a/apps/authentication/views/dingtalk.py b/apps/authentication/views/dingtalk.py index 630125151..70bb9211d 100644 --- a/apps/authentication/views/dingtalk.py +++ b/apps/authentication/views/dingtalk.py @@ -14,11 +14,11 @@ from users.models import User from common.utils import get_logger, FlashMessageUtil from common.utils.random import random_string from common.utils.django import reverse, get_object_or_none -from common.message.backends.dingtalk import URL +from common.sdk.im.dingtalk import URL from common.mixins.views import PermissionsMixin from authentication import errors from authentication.mixins import AuthMixin -from common.message.backends.dingtalk import DingTalk +from common.sdk.im.dingtalk import DingTalk logger = get_logger(__file__) diff --git a/apps/authentication/views/feishu.py b/apps/authentication/views/feishu.py index 19f9f0bb3..597b83e46 100644 --- a/apps/authentication/views/feishu.py +++ b/apps/authentication/views/feishu.py @@ -15,7 +15,7 @@ from common.utils import get_logger, FlashMessageUtil from common.utils.random import random_string from common.utils.django import reverse, get_object_or_none from common.mixins.views import PermissionsMixin -from common.message.backends.feishu import FeiShu, URL +from common.sdk.im.feishu import FeiShu, URL from authentication import errors from authentication.mixins import AuthMixin diff --git a/apps/authentication/views/wecom.py b/apps/authentication/views/wecom.py index c3e9068e5..793479ccc 100644 --- a/apps/authentication/views/wecom.py +++ b/apps/authentication/views/wecom.py @@ -14,8 +14,8 @@ from users.models import User from common.utils import get_logger, FlashMessageUtil from common.utils.random import random_string from common.utils.django import reverse, get_object_or_none -from common.message.backends.wecom import URL -from common.message.backends.wecom import WeCom +from common.sdk.im.wecom import URL +from common.sdk.im.wecom import WeCom from common.mixins.views import PermissionsMixin from authentication import errors from authentication.mixins import AuthMixin diff --git a/apps/common/message/__init__.py b/apps/common/sdk/__init__.py similarity index 100% rename from apps/common/message/__init__.py rename to apps/common/sdk/__init__.py diff --git a/apps/common/message/backends/__init__.py b/apps/common/sdk/im/__init__.py similarity index 100% rename from apps/common/message/backends/__init__.py rename to apps/common/sdk/im/__init__.py diff --git a/apps/common/message/backends/dingtalk/__init__.py b/apps/common/sdk/im/dingtalk/__init__.py similarity index 98% rename from apps/common/message/backends/dingtalk/__init__.py rename to apps/common/sdk/im/dingtalk/__init__.py index 3f07ba2a0..bd802a8d5 100644 --- a/apps/common/message/backends/dingtalk/__init__.py +++ b/apps/common/sdk/im/dingtalk/__init__.py @@ -3,8 +3,8 @@ import hmac import base64 from common.utils import get_logger -from common.message.backends.utils import digest, as_request -from common.message.backends.mixin import BaseRequest +from common.sdk.im.utils import digest, as_request +from common.sdk.im.mixin import BaseRequest logger = get_logger(__file__) diff --git a/apps/common/message/backends/exceptions.py b/apps/common/sdk/im/exceptions.py similarity index 100% rename from apps/common/message/backends/exceptions.py rename to apps/common/sdk/im/exceptions.py diff --git a/apps/common/message/backends/feishu/__init__.py b/apps/common/sdk/im/feishu/__init__.py similarity index 96% rename from apps/common/message/backends/feishu/__init__.py rename to apps/common/sdk/im/feishu/__init__.py index f9f1ee0e4..1cfee9cdd 100644 --- a/apps/common/message/backends/feishu/__init__.py +++ b/apps/common/sdk/im/feishu/__init__.py @@ -4,8 +4,8 @@ from django.utils.translation import ugettext_lazy as _ from rest_framework.exceptions import APIException from common.utils.common import get_logger -from common.message.backends.utils import digest -from common.message.backends.mixin import RequestMixin, BaseRequest +from common.sdk.im.utils import digest +from common.sdk.im.mixin import RequestMixin, BaseRequest logger = get_logger(__name__) diff --git a/apps/common/message/backends/mixin.py b/apps/common/sdk/im/mixin.py similarity index 98% rename from apps/common/message/backends/mixin.py rename to apps/common/sdk/im/mixin.py index af151a536..94e4ca73c 100644 --- a/apps/common/message/backends/mixin.py +++ b/apps/common/sdk/im/mixin.py @@ -6,7 +6,7 @@ from django.core.cache import cache from .utils import DictWrapper from common.utils.common import get_logger from common.utils import lazyproperty -from common.message.backends.utils import set_default, as_request +from common.sdk.im.utils import set_default, as_request from . import exceptions as exce diff --git a/apps/common/message/backends/sms/__init__.py b/apps/common/sdk/im/sms/__init__.py similarity index 100% rename from apps/common/message/backends/sms/__init__.py rename to apps/common/sdk/im/sms/__init__.py diff --git a/apps/common/message/backends/sms/alibaba.py b/apps/common/sdk/im/sms/alibaba.py similarity index 100% rename from apps/common/message/backends/sms/alibaba.py rename to apps/common/sdk/im/sms/alibaba.py diff --git a/apps/common/message/backends/sms/tencent.py b/apps/common/sdk/im/sms/tencent.py similarity index 100% rename from apps/common/message/backends/sms/tencent.py rename to apps/common/sdk/im/sms/tencent.py diff --git a/apps/common/message/backends/utils.py b/apps/common/sdk/im/utils.py similarity index 97% rename from apps/common/message/backends/utils.py rename to apps/common/sdk/im/utils.py index 45bea6d94..2386d0eff 100644 --- a/apps/common/message/backends/utils.py +++ b/apps/common/sdk/im/utils.py @@ -3,7 +3,7 @@ import inspect from inspect import Parameter from common.utils.common import get_logger -from common.message.backends import exceptions as exce +from common.sdk.im import exceptions as exce logger = get_logger(__name__) diff --git a/apps/common/message/backends/wecom/__init__.py b/apps/common/sdk/im/wecom/__init__.py similarity index 97% rename from apps/common/message/backends/wecom/__init__.py rename to apps/common/sdk/im/wecom/__init__.py index 730ebcbf6..7640228e9 100644 --- a/apps/common/message/backends/wecom/__init__.py +++ b/apps/common/sdk/im/wecom/__init__.py @@ -4,8 +4,8 @@ from django.utils.translation import ugettext_lazy as _ from rest_framework.exceptions import APIException from common.utils.common import get_logger -from common.message.backends.utils import digest, DictWrapper, update_values, set_default -from common.message.backends.mixin import RequestMixin, BaseRequest +from common.sdk.im.utils import digest, DictWrapper, update_values, set_default +from common.sdk.im.mixin import RequestMixin, BaseRequest logger = get_logger(__name__) diff --git a/apps/notifications/backends/dingtalk.py b/apps/notifications/backends/dingtalk.py index ba72091a4..426a05fc0 100644 --- a/apps/notifications/backends/dingtalk.py +++ b/apps/notifications/backends/dingtalk.py @@ -1,5 +1,5 @@ from django.conf import settings -from common.message.backends.dingtalk import DingTalk as Client +from common.sdk.im.dingtalk import DingTalk as Client from .base import BackendBase diff --git a/apps/notifications/backends/feishu.py b/apps/notifications/backends/feishu.py index 434898c8a..659c77591 100644 --- a/apps/notifications/backends/feishu.py +++ b/apps/notifications/backends/feishu.py @@ -1,6 +1,6 @@ from django.conf import settings -from common.message.backends.feishu import FeiShu as Client +from common.sdk.im.feishu import FeiShu as Client from .base import BackendBase diff --git a/apps/notifications/backends/sms.py b/apps/notifications/backends/sms.py index 77a720a04..798711f77 100644 --- a/apps/notifications/backends/sms.py +++ b/apps/notifications/backends/sms.py @@ -1,6 +1,6 @@ from django.conf import settings -from common.message.backends.sms.alibaba import AlibabaSMS as Client +from common.sdk.im.sms.alibaba import AlibabaSMS as Client from .base import BackendBase diff --git a/apps/notifications/backends/wecom.py b/apps/notifications/backends/wecom.py index 988c904c2..c2aadd4a9 100644 --- a/apps/notifications/backends/wecom.py +++ b/apps/notifications/backends/wecom.py @@ -1,6 +1,6 @@ from django.conf import settings -from common.message.backends.wecom import WeCom as Client +from common.sdk.im.wecom import WeCom as Client from .base import BackendBase diff --git a/apps/settings/api/alibaba_sms.py b/apps/settings/api/alibaba_sms.py index 32460778e..cf905d68f 100644 --- a/apps/settings/api/alibaba_sms.py +++ b/apps/settings/api/alibaba_sms.py @@ -4,7 +4,7 @@ from rest_framework.exceptions import APIException from rest_framework import status from django.utils.translation import gettext_lazy as _ -from common.message.backends.sms.alibaba import AlibabaSMS +from common.sdk.im.sms.alibaba import AlibabaSMS from settings.models import Setting from common.permissions import IsSuperUser from common.exceptions import JMSException diff --git a/apps/settings/api/dingtalk.py b/apps/settings/api/dingtalk.py index abb28e9da..8164198de 100644 --- a/apps/settings/api/dingtalk.py +++ b/apps/settings/api/dingtalk.py @@ -6,7 +6,7 @@ from django.utils.translation import gettext_lazy as _ from django.conf import settings from common.permissions import IsSuperUser -from common.message.backends.dingtalk import DingTalk +from common.sdk.im.dingtalk import DingTalk from .. import serializers diff --git a/apps/settings/api/feishu.py b/apps/settings/api/feishu.py index 3e3d720b1..e9b3a391a 100644 --- a/apps/settings/api/feishu.py +++ b/apps/settings/api/feishu.py @@ -6,7 +6,7 @@ from django.utils.translation import gettext_lazy as _ from settings.models import Setting from common.permissions import IsSuperUser -from common.message.backends.feishu import FeiShu +from common.sdk.im.feishu import FeiShu from .. import serializers diff --git a/apps/settings/api/sms.py b/apps/settings/api/sms.py index 194dbc608..4809e9ddc 100644 --- a/apps/settings/api/sms.py +++ b/apps/settings/api/sms.py @@ -2,7 +2,7 @@ from rest_framework.generics import ListAPIView from rest_framework.response import Response from common.permissions import IsSuperUser -from common.message.backends.sms import BACKENDS +from common.sdk.im.sms import BACKENDS from settings.serializers.sms import SMSBackendSerializer diff --git a/apps/settings/api/tencent_sms.py b/apps/settings/api/tencent_sms.py index 5395a1305..0b4cdd69e 100644 --- a/apps/settings/api/tencent_sms.py +++ b/apps/settings/api/tencent_sms.py @@ -6,7 +6,7 @@ from rest_framework.exceptions import APIException from rest_framework import status from django.utils.translation import gettext_lazy as _ -from common.message.backends.sms.tencent import TencentSMS +from common.sdk.im.sms.tencent import TencentSMS from settings.models import Setting from common.permissions import IsSuperUser from common.exceptions import JMSException diff --git a/apps/settings/api/wecom.py b/apps/settings/api/wecom.py index 39d1576b5..fce5ddad5 100644 --- a/apps/settings/api/wecom.py +++ b/apps/settings/api/wecom.py @@ -6,7 +6,7 @@ from django.utils.translation import gettext_lazy as _ from settings.models import Setting from common.permissions import IsSuperUser -from common.message.backends.wecom import WeCom +from common.sdk.im.wecom import WeCom from .. import serializers diff --git a/apps/settings/serializers/auth/sms.py b/apps/settings/serializers/auth/sms.py index 8320b11eb..808141726 100644 --- a/apps/settings/serializers/auth/sms.py +++ b/apps/settings/serializers/auth/sms.py @@ -1,7 +1,7 @@ from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers -from common.message.backends.sms import BACKENDS +from common.sdk.im.sms import BACKENDS __all__ = ['SMSSettingSerializer', 'AlibabaSMSSettingSerializer', 'TencentSMSSettingSerializer']