Skip to content

Commit c3169dc

Browse files
committed
fix(backend): 修改循环导入的问题 #16093
# Reviewed, transaction id: 73205
1 parent 2c1ed6e commit c3169dc

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

dbm-ui/backend/components/cmsi/client.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
from django.utils.translation import gettext_lazy as _
1313

14-
from ...core.notify.constants import MsgType
1514
from ..base import BaseApi
1615
from ..domains import CMSI_APIGW_DOMAIN
1716

@@ -21,12 +20,16 @@ class _CmsiApi(BaseApi):
2120
BASE = CMSI_APIGW_DOMAIN
2221

2322
# 消息类型映射定义
24-
MSG_TYPE_MAP = {
25-
MsgType.VOICE.value: "send_voice",
26-
MsgType.SMS.value: "send_sms",
27-
MsgType.WEIXIN.value: "send_weixin",
28-
MsgType.MAIL.value: "send_mail",
29-
}
23+
@property
24+
def MSG_TYPE_MAP(self):
25+
from ...core.notify.constants import MsgType
26+
27+
return {
28+
MsgType.VOICE.value: "send_voice",
29+
MsgType.SMS.value: "send_sms",
30+
MsgType.WEIXIN.value: "send_weixin",
31+
MsgType.MAIL.value: "send_mail",
32+
}
3033

3134
def __init__(self):
3235
self.get_msg_type = self.generate_data_api(

0 commit comments

Comments
 (0)