2023-07-24 03:52:25 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2021-09-09 06:00:50 +00:00
|
|
|
from rest_framework import serializers
|
|
|
|
|
2023-01-16 11:02:09 +00:00
|
|
|
from common.serializers.fields import EncryptedField
|
2022-05-20 02:01:41 +00:00
|
|
|
|
2021-09-09 06:00:50 +00:00
|
|
|
__all__ = ['FeiShuSettingSerializer']
|
|
|
|
|
|
|
|
|
|
|
|
class FeiShuSettingSerializer(serializers.Serializer):
|
2023-02-23 08:38:44 +00:00
|
|
|
PREFIX_TITLE = _('FeiShu')
|
2022-11-04 06:22:38 +00:00
|
|
|
|
2023-03-10 07:07:14 +00:00
|
|
|
VERSION_CHOICES = (
|
2023-03-10 07:11:37 +00:00
|
|
|
('feishu', _('FeiShu')),
|
2023-03-10 07:07:14 +00:00
|
|
|
('lark', 'Lark')
|
|
|
|
)
|
|
|
|
AUTH_FEISHU = serializers.BooleanField(default=False, label=_('Enable FeiShu Auth'))
|
2021-09-09 06:00:50 +00:00
|
|
|
FEISHU_APP_ID = serializers.CharField(max_length=256, required=True, label='App ID')
|
2022-05-20 02:01:41 +00:00
|
|
|
FEISHU_APP_SECRET = EncryptedField(max_length=256, required=False, label='App Secret')
|
2023-03-10 07:07:14 +00:00
|
|
|
FEISHU_VERSION = serializers.ChoiceField(
|
|
|
|
choices=VERSION_CHOICES, default='feishu', label=_('Version')
|
|
|
|
)
|