from rest_framework import serializers


class SendSmsSerializer(serializers.Serializer):
    phone = serializers.CharField(label='手机号')
    template_code = serializers.CharField(label='模板标识')
    template_param = serializers.JSONField(label='模板参数')


class GenerateVoiceSerializer(serializers.Serializer):
    msg = serializers.CharField(label='文本')


class TestTaskSerializer(serializers.Serializer):
    func = serializers.CharField(label='函数名称')
    args = serializers.ListField(child=serializers.CharField(), label='列表参数', required=False, allow_null=True)
    kwargs = serializers.JSONField(label="字典参数", required=False, allow_null=True)
    delay = serializers.BooleanField(label="是否延迟执行", default=False)


class CleanDataSerializer(serializers.Serializer):
    datas = serializers.ListField(child=serializers.CharField(), label='数据分类列表', required=False, allow_null=True)


class TestAlgoSerializer(serializers.Serializer):
    codes = serializers.ListField(child=serializers.CharField(), label='需要识别的算法')
    face_img = serializers.CharField()
    global_img = serializers.CharField()
    is_dahua_pic = serializers.BooleanField()


class SpeakerSerializer(serializers.Serializer):
    text_or_path = serializers.CharField(label='文本或音频文件路径')
    sns = serializers.ListField(child=serializers.CharField(), label="喇叭列表")


class AreaManSerializer(serializers.Serializer):
    area = serializers.CharField()


class ServerTimeSerializer(serializers.Serializer):
    server_time = serializers.DateTimeField()
    timezone = serializers.CharField(read_only=True)