From ccc9a176f45ed8e9da1a818b1b2143dc9eb07d24 Mon Sep 17 00:00:00 2001 From: youngS Date: Mon, 25 Jan 2021 12:13:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=88=A4=E6=96=AD=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=90=8C=E6=AD=A5=E5=8F=AA=E5=A2=9E=E4=B8=8D=E5=87=8F?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/migrations/0011_auto_20210125_1137.py | 22 +++++++++++++++++++ fir_ser/api/models.py | 4 +++- fir_ser/api/utils/app/supersignutils.py | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 fir_ser/api/migrations/0011_auto_20210125_1137.py diff --git a/fir_ser/api/migrations/0011_auto_20210125_1137.py b/fir_ser/api/migrations/0011_auto_20210125_1137.py new file mode 100644 index 0000000..e5d967d --- /dev/null +++ b/fir_ser/api/migrations/0011_auto_20210125_1137.py @@ -0,0 +1,22 @@ +# Generated by Django 3.0.3 on 2021-01-25 11:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0010_userinfo_api_token'), + ] + + operations = [ + migrations.RemoveField( + model_name='udidsyncdeveloper', + name='created_time', + ), + migrations.AddField( + model_name='udidsyncdeveloper', + name='platform', + field=models.SmallIntegerField(choices=[(0, 'app developer'), (1, 'fly分发')], default=0, verbose_name='udid所在平台'), + ), + ] diff --git a/fir_ser/api/models.py b/fir_ser/api/models.py index 730bf44..31dc3ad 100644 --- a/fir_ser/api/models.py +++ b/fir_ser/api/models.py @@ -270,7 +270,9 @@ class UDIDsyncDeveloper(models.Model): product = models.CharField(max_length=64, verbose_name="产品", blank=True, null=True, ) serial = models.CharField(max_length=64, verbose_name="序列号", blank=True, null=True, ) version = models.CharField(max_length=64, verbose_name="型号", blank=True, null=True, ) - created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") + created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间"), + platform_choices = ((0, 'fly分发'), (1, 'app developer'),) + platform = models.SmallIntegerField(choices=platform_choices, default=0, verbose_name="udid所在平台") class Meta: verbose_name = 'iOS开发平台同步设备信息' diff --git a/fir_ser/api/utils/app/supersignutils.py b/fir_ser/api/utils/app/supersignutils.py index a5d4a0b..f9bfbfe 100644 --- a/fir_ser/api/utils/app/supersignutils.py +++ b/fir_ser/api/utils/app/supersignutils.py @@ -483,6 +483,7 @@ class IosUtils(object): "get_device_from_developer developer_obj:%s user_obj:%s delete file failed Exception:%s" % ( developer_obj, user_obj, e)) + UDIDsyncDeveloper.objects.filter(developerid=developer_obj, platform=1).delete() for devicestr in devices_info.split(">"): formatdevice = re.findall(r'.*Device id="(.*)",.*name="(.*)",.*udid="(.*?)",.*model=(.*),.*', devicestr) if formatdevice: @@ -491,6 +492,7 @@ class IosUtils(object): "product": formatdevice[0][1], "udid": formatdevice[0][2], "version": formatdevice[0][3], + "platform": 1 } app_udid_obj = UDIDsyncDeveloper.objects.filter(developerid=developer_obj, udid=device.get("udid")) if app_udid_obj: