| 
 | 1 | +# -*- coding: utf-8 -*-  | 
 | 2 | +"""  | 
 | 3 | +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.  | 
 | 4 | +Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.  | 
 | 5 | +Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.  | 
 | 6 | +You may obtain a copy of the License at https://opensource.org/licenses/MIT  | 
 | 7 | +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on  | 
 | 8 | +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the  | 
 | 9 | +specific language governing permissions and limitations under the License.  | 
 | 10 | +"""  | 
 | 11 | +from django.utils.translation import ugettext as _  | 
 | 12 | + | 
 | 13 | +from backend.ticket.constants import TicketStatus  | 
 | 14 | +from blue_krill.data_types.enum import EnumField, StructuredEnum  | 
 | 15 | + | 
 | 16 | + | 
 | 17 | +class MsgType(str, StructuredEnum):  | 
 | 18 | +    SMS = EnumField("sms", _("短信"))  | 
 | 19 | +    WEIXIN = EnumField("weixin", _("微信"))  | 
 | 20 | +    MAIL = EnumField("mail", _("邮件"))  | 
 | 21 | +    VOICE = EnumField("voice", _("语音"))  | 
 | 22 | +    RTX = EnumField("rtx", _("企业微信"))  | 
 | 23 | +    WECOM_ROBOT = EnumField("wecom_robot", _("企业微信机器人"))  | 
 | 24 | +    # 未知发送类型,配置此type一般用于跳过消息发送  | 
 | 25 | +    UNKNOWN = EnumField("unknown", _("未知"))  | 
 | 26 | + | 
 | 27 | + | 
 | 28 | +# 默认通知:微信和邮件  | 
 | 29 | +DEFAULT_BIZ_NOTIFY_CONFIG = {  | 
 | 30 | +    status: {MsgType.RTX.value: True, MsgType.MAIL.value: True} for status in TicketStatus.get_values()  | 
 | 31 | +}  | 
0 commit comments