2021-09-09 06:00:50 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from rest_framework import serializers
|
|
|
|
|
2022-05-20 02:01:41 +00:00
|
|
|
from common.drf.fields import EncryptedField
|
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
__all__ = ['WeComSettingSerializer']
|
|
|
|
|
|
|
|
|
|
|
|
class WeComSettingSerializer(serializers.Serializer):
|
2022-11-04 06:22:38 +00:00
|
|
|
PREFIX_TITLE = '%s-%s' % (_('Authentication'), _('WeCom'))
|
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
WECOM_CORPID = serializers.CharField(max_length=256, required=True, label='corpid')
|
|
|
|
WECOM_AGENTID = serializers.CharField(max_length=256, required=True, label='agentid')
|
2022-05-20 02:01:41 +00:00
|
|
|
WECOM_SECRET = EncryptedField(max_length=256, required=False, label='secret')
|
|
|
|
AUTH_WECOM = serializers.BooleanField(default=False, label=_('Enable WeCom Auth'))
|