diff --git a/fir_ser/api/migrations/0001_initial.py b/fir_ser/api/migrations/0001_initial.py index 0153fe6..8dd6e8c 100644 --- a/fir_ser/api/migrations/0001_initial.py +++ b/fir_ser/api/migrations/0001_initial.py @@ -1,69 +1,18 @@ -# Generated by Django 3.0.3 on 2021-05-27 13:55 +# Generated by Django 3.2.3 on 2022-02-15 21:26 import django.contrib.auth.models import django.db.models.deletion from django.conf import settings from django.db import migrations, models -price_info_list = [ - { - "name": "1k_times", - "title": "1k_times", - "description": "1k_times", - "price": 2500, - "package_size": 1000, - "download_count_gift": 100, - "is_enable": True, - }, - { - "name": "10k_times", - "title": "10k_times", - "description": "10k_times", - "price": 22000, - "package_size": 10000, - "download_count_gift": 800, - "is_enable": True, - }, - { - "name": "100k_times", - "title": "100k_times", - "description": "100k_times", - "price": 200000, - "package_size": 100000, - "download_count_gift": 8000, - "is_enable": True, - }, -] -WEB_DOMAIN = settings.WEB_DOMAIN.split('//')[1] -domain_cname_info_list = [ - { - "domain_record": WEB_DOMAIN, - "ip_address": WEB_DOMAIN, - "is_enable": True, - "is_system": True, - "is_https": True if settings.WEB_DOMAIN.startswith('https') else False, - "description": f"默认下载页域名 {WEB_DOMAIN}", - }, -] - - -def add_default_price(apps, schema_editor): - for price in price_info_list: - price_model = apps.get_model('api', 'Price') - price_model.objects.create(**price) - - -def add_default_domain_cname(apps, schema_editor): - for domain_cname_info in domain_cname_info_list: - domain_cname_info_model = apps.get_model('api', 'DomainCnameInfo') - domain_cname_info_model.objects.create(**domain_cname_info) +import common.base.daobase class Migration(migrations.Migration): initial = True dependencies = [ - ('auth', '0011_update_proxy_permissions'), + ('auth', '0012_alter_user_first_name_max_length'), ] operations = [ @@ -76,20 +25,19 @@ class Migration(migrations.Migration): ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), - ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), + ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')), ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), ('username', models.CharField(max_length=64, unique=True, verbose_name='用户名')), ('email', - models.EmailField(blank=True, max_length=255, null=True, unique=True, verbose_name='email address')), + models.EmailField(blank=True, db_index=True, max_length=255, null=True, verbose_name='email address')), ('uid', models.CharField(db_index=True, max_length=64, unique=True)), - ('mobile', models.BigIntegerField(help_text='用于手机验证码登录', null=True, unique=True, verbose_name='手机')), - ('qq', models.BigIntegerField(blank=True, db_index=True, null=True, verbose_name='QQ')), + ('mobile', models.BigIntegerField(db_index=True, help_text='用于手机验证码登录', null=True, verbose_name='手机')), ('is_active', models.BooleanField(default=True, verbose_name='账户状态,默认启用')), ('storage_active', models.BooleanField(default=False, verbose_name='配置存储,默认关闭')), - ('supersign_active', models.BooleanField(default=False, verbose_name='配置超级签,默认关闭')), + ('supersign_active', models.BooleanField(default=True, verbose_name='配置超级签,默认关闭')), ('job', models.TextField(blank=True, max_length=128, null=True, verbose_name='职位')), ('company', models.CharField(blank=True, max_length=128, null=True, verbose_name='公司')), ('gender', @@ -113,30 +61,6 @@ class Migration(migrations.Migration): ('objects', django.contrib.auth.models.UserManager()), ], ), - migrations.CreateModel( - name='AppIOSDeveloperInfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('issuer_id', models.CharField(max_length=64, verbose_name='标识创建认证令牌的发放者')), - ('private_key_id', models.CharField(max_length=64, verbose_name='密钥 ID')), - ('p8key', models.TextField(max_length=512, verbose_name='p8key')), - ('is_actived', models.BooleanField(default=False, verbose_name='是否已经激活')), - ('certid', models.CharField(blank=True, max_length=64, null=True, verbose_name='超级签名自动创建证书ID')), - ('usable_number', models.IntegerField(default=100, verbose_name='可使用设备数')), - ('use_number', models.IntegerField(default=0, verbose_name='已消耗设备数')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), - ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), - ('cert_expire_time', models.DateTimeField(blank=True, null=True, verbose_name='证书过期时间')), - ('description', models.TextField(blank=True, default='', null=True, verbose_name='备注')), - ('auth_type', models.SmallIntegerField(choices=[(0, 'p8key认证')], default=0, verbose_name='认证类型')), - ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, - verbose_name='用户ID')), - ], - options={ - 'verbose_name': '苹果开发者账户', - 'verbose_name_plural': '苹果开发者账户', - }, - ), migrations.CreateModel( name='Apps', fields=[ @@ -153,18 +77,21 @@ class Migration(migrations.Migration): ('password', models.CharField(blank=True, help_text='默认 没有密码', max_length=32, verbose_name='访问密码')), ('isshow', models.BooleanField(default=True, verbose_name='下载页可见')), ('issupersign', models.BooleanField(default=False, verbose_name='是否超级签名包')), + ('change_auto_sign', models.BooleanField(default=False, verbose_name='签名相关的数据更新自动签名')), ('supersign_type', models.SmallIntegerField( choices=[(0, '普通权限'), (1, '推送权限,请上传adhoc包'), (2, 'network、vpn、推送权限,请上传adhoc包'), (3, '特殊权限')], default=1, verbose_name='签名类型')), ('new_bundle_id', models.CharField(blank=True, help_text='用于超级签某些因素下需要修改包名', max_length=64, null=True, verbose_name='new_bundle_id')), + ('new_bundle_name', models.CharField(blank=True, help_text='应用新名称', max_length=64, null=True, + verbose_name='new_bundle_name')), ('supersign_limit_number', models.IntegerField(default=0, verbose_name='签名使用限额')), ('wxredirect', models.BooleanField(default=True, verbose_name='微信内第三方链接自动跳转')), ('wxeasytype', models.BooleanField(default=True, verbose_name='微信内简易模式,避免微信封停')), ('description', models.TextField(blank=True, default=None, null=True, verbose_name='描述')), ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), ('has_combo', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, - related_name='combo_app_info', to='api.Apps', verbose_name='关联应用')), + related_name='combo_app_info', to='api.apps', verbose_name='关联应用')), ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户ID')), ], @@ -190,6 +117,38 @@ class Migration(migrations.Migration): 'verbose_name_plural': '系统分发域名配置', }, ), + migrations.CreateModel( + name='RemoteClientInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('remote_addr', models.GenericIPAddressField(verbose_name='远程IP地址')), + ('user_agent', models.CharField(max_length=512, verbose_name='客户端agent')), + ('method', models.CharField(max_length=16, verbose_name='请求方式')), + ('uri_info', models.CharField(max_length=256, verbose_name='访问的URI')), + ('a_domain', models.CharField(max_length=128, verbose_name='前端域名')), + ('description', models.CharField(max_length=256, verbose_name='访问描述')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='访问时间')), + ], + options={ + 'verbose_name': '客户端访问记录', + 'verbose_name_plural': '客户端访问记录', + }, + ), + migrations.CreateModel( + name='SystemConfig', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('key', models.CharField(max_length=128, unique=True, verbose_name='配置名称')), + ('value', models.TextField(max_length=10240, verbose_name='配置值')), + ('enable', models.BooleanField(default=True, verbose_name='是否启用该配置项')), + ('description', models.CharField(blank=True, default='', max_length=256, verbose_name='备注')), + ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), + ], + options={ + 'verbose_name': '系统配置项', + 'verbose_name_plural': '系统配置项', + }, + ), migrations.CreateModel( name='VerifyName', fields=[ @@ -212,12 +171,17 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('domain_name', models.CharField(db_index=True, max_length=64, verbose_name='下载页面域名')), + ('is_https', models.BooleanField(default=False, verbose_name='是否支持HTTPS')), + ('weight', models.IntegerField(default=10, verbose_name='下载页域名展示权重')), ('is_enable', models.BooleanField(default=False, verbose_name='绑定成功')), ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), + ('domain_type', models.SmallIntegerField(choices=[(0, '下载码域名'), (1, '下载页域名'), (2, '应用专用域名')], default=1, + help_text='0 表示下载码域名,扫描下载码域名,会自动跳转到预览域名', + verbose_name='域名类型')), ('app_id', - models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Apps', + models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='api.apps', verbose_name='APP专属域名')), - ('cname_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.DomainCnameInfo', + ('cname_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.domaincnameinfo', verbose_name='cname解析ID')), ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户ID')), @@ -251,22 +215,22 @@ class Migration(migrations.Migration): }, ), migrations.CreateModel( - name='UDIDsyncDeveloper', + name='UserAdDisplayInfo', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('udid', models.CharField(db_index=True, max_length=64, verbose_name='udid唯一标识')), - ('product', models.CharField(blank=True, max_length=64, null=True, verbose_name='产品')), - ('serial', models.CharField(blank=True, max_length=64, null=True, verbose_name='序列号')), - ('version', models.CharField(blank=True, max_length=64, null=True, verbose_name='型号')), - ('platform', models.SmallIntegerField(choices=[(0, 'fly分发'), (1, 'app developer')], default=0, - verbose_name='udid所在平台')), - ('developerid', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.AppIOSDeveloperInfo', - verbose_name='所使用苹果开发者账户')), + ('ad_name', models.CharField(max_length=256, verbose_name='广告名称')), + ('ad_uri', models.CharField(max_length=256, verbose_name='广告跳转地址')), + ('ad_pic', models.CharField(help_text='像素最高80px', max_length=256, verbose_name='广告图片地址')), + ('weight', models.IntegerField(default=10, verbose_name='广告展示权重')), + ('description', models.TextField(blank=True, default='', null=True, verbose_name='描述信息')), + ('is_enable', models.BooleanField(default=False, verbose_name='广告开启状态')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='广告创建时间')), + ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, + verbose_name='用户ID')), ], options={ - 'verbose_name': 'iOS开发平台同步设备信息', - 'verbose_name_plural': 'iOS开发平台同步设备信息', + 'verbose_name': '用户自定义广告', + 'verbose_name_plural': '用户自定义广告', }, ), migrations.CreateModel( @@ -274,11 +238,28 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('access_token', models.CharField(max_length=64, unique=True)), + ('remote_addr', models.GenericIPAddressField(blank=True, null=True, verbose_name='远程IP地址')), ('created', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='auth_token', to=settings.AUTH_USER_MODEL, verbose_name='关联用户')), ], ), + migrations.CreateModel( + name='ThirdWeChatUserInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('openid', models.CharField(max_length=64, unique=True, verbose_name='普通用户的标识,对当前公众号唯一')), + ('nickname', models.CharField(blank=True, max_length=64, verbose_name='昵称')), + ('sex', models.SmallIntegerField(default=0, help_text='值为1时是男性,值为2时是女性,值为0时是未知', verbose_name='性别')), + ('subscribe_time', models.BigIntegerField(verbose_name='订阅时间')), + ('head_img_url', models.CharField(blank=True, max_length=256, null=True, verbose_name='用户头像')), + ('address', models.CharField(blank=True, max_length=128, null=True, verbose_name='地址')), + ('subscribe', models.BooleanField(default=0, verbose_name='是否订阅公众号')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='授权时间')), + ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, + verbose_name='用户ID')), + ], + ), migrations.CreateModel( name='Price', fields=[ @@ -312,51 +293,16 @@ class Migration(migrations.Migration): ('status', models.SmallIntegerField( choices=[(0, '交易成功'), (1, '待支付'), (2, '订单已创建'), (3, '退费申请中'), (4, '已退费'), (5, '主动取消'), (6, '超时取消')], verbose_name='状态')), - ('order_type', - models.SmallIntegerField(choices=[(0, '用户下单'), (1, '后台充值')], default=0, verbose_name='订单类型')), + ('order_type', models.SmallIntegerField(choices=[(0, '用户下单'), (1, '后台充值'), (2, '系统赠送')], default=0, + verbose_name='订单类型')), ('pay_time', models.DateTimeField(blank=True, null=True, verbose_name='付款时间')), ('cancel_time', models.DateTimeField(blank=True, null=True, verbose_name='订单取消时间')), ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='订单创建时间')), ('description', models.TextField(blank=True, default='', null=True, verbose_name='备注')), ( - 'user_id', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + 'user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), - migrations.CreateModel( - name='DeveloperDevicesID', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('did', models.CharField(max_length=64)), - ('app_id', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Apps', verbose_name='属于哪个APP')), - ('developerid', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.AppIOSDeveloperInfo', - verbose_name='所使用苹果开发者账户')), - ('udid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.UDIDsyncDeveloper', - verbose_name='所消耗的udid')), - ], - options={ - 'verbose_name': '超级签Devices id', - 'verbose_name_plural': '超级签Devices id', - }, - ), - migrations.CreateModel( - name='DeveloperAppID', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('aid', models.CharField(max_length=64)), - ('app_id', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Apps', verbose_name='属于哪个APP')), - ('developerid', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.AppIOSDeveloperInfo', - verbose_name='所使用苹果开发者账户')), - ], - options={ - 'verbose_name': '超级签APP id', - 'verbose_name_plural': '超级签APP id', - }, - ), migrations.CreateModel( name='CertificationInfo', fields=[ @@ -374,68 +320,6 @@ class Migration(migrations.Migration): 'verbose_name_plural': '身份证截图', }, ), - migrations.CreateModel( - name='AppUDID', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('udid', models.CharField(db_index=True, max_length=64, verbose_name='udid唯一标识')), - ('product', models.CharField(blank=True, max_length=64, null=True, verbose_name='产品')), - ('serial', models.CharField(blank=True, max_length=64, null=True, verbose_name='序列号')), - ('version', models.CharField(blank=True, max_length=64, null=True, verbose_name='型号')), - ('imei', models.CharField(blank=True, max_length=64, null=True, verbose_name='型号')), - ('iccid', models.CharField(blank=True, max_length=64, null=True, verbose_name='型号')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), - ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), - ('is_signed', models.BooleanField(default=False, verbose_name='是否完成签名打包')), - ('binary_file', models.CharField(blank=True, max_length=128, null=True, verbose_name='签名包名称')), - ('app_id', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Apps', verbose_name='属于哪个APP')), - ], - options={ - 'verbose_name': '设备详情', - 'verbose_name_plural': '设备详情', - }, - ), - migrations.CreateModel( - name='APPToDeveloper', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('binary_file', - models.CharField(blank=True, max_length=128, null=True, unique=True, verbose_name='签名包名称')), - ('release_file', models.CharField(blank=True, max_length=128, null=True, verbose_name='源包名称')), - ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), - ('app_id', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Apps', verbose_name='属于哪个APP')), - ('developerid', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.AppIOSDeveloperInfo', - verbose_name='所使用苹果开发者账户')), - ], - options={ - 'verbose_name': '应用开发者绑定', - 'verbose_name_plural': '应用开发者绑定', - }, - ), - migrations.CreateModel( - name='APPSuperSignUsedInfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), - ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), - ('app_id', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Apps', verbose_name='属于哪个APP')), - ('developerid', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.AppIOSDeveloperInfo', - verbose_name='所使用苹果开发者账户')), - ('udid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.AppUDID', - verbose_name='所消耗的udid')), - ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, - verbose_name='用户ID')), - ], - options={ - 'verbose_name': '设备使用统计', - 'verbose_name_plural': '设备使用统计', - }, - ), migrations.CreateModel( name='AppStorage', fields=[ @@ -445,10 +329,10 @@ class Migration(migrations.Migration): models.SmallIntegerField(choices=[(0, '本地存储'), (1, '七牛云存储'), (2, '阿里云存储'), (3, '默认存储')], default=3, verbose_name='存储类型')), ('access_key', models.CharField(blank=True, max_length=128, null=True, verbose_name='存储访问key')), - ('secret_key', models.CharField(blank=True, max_length=128, null=True, verbose_name='存储访问secret')), + ('secret_key', + common.base.daobase.AESCharField(blank=True, max_length=128, null=True, verbose_name='存储访问secret')), ( - 'bucket_name', - models.CharField(blank=True, max_length=128, null=True, verbose_name='存储空间bucket_name')), + 'bucket_name', models.CharField(blank=True, max_length=128, null=True, verbose_name='存储空间bucket_name')), ('domain_name', models.CharField(blank=True, help_text='fly-storage.dvcloud.xin,可以自定义端口', max_length=128, null=True, verbose_name='下载域名')), @@ -479,23 +363,47 @@ class Migration(migrations.Migration): ('screenshot_url', models.CharField(blank=True, max_length=128, verbose_name='应用截图URL')), ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), ('app_id', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Apps', verbose_name='属于哪个APP')), + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.apps', verbose_name='属于哪个APP')), ], options={ 'verbose_name': '应用截图', 'verbose_name_plural': '应用截图', }, ), + migrations.CreateModel( + name='AppReportInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('app_name', models.CharField(blank=True, max_length=32, null=True, verbose_name='应用名称')), + ('bundle_id', models.CharField(blank=True, max_length=64, verbose_name='bundle id')), + ('remote_addr', models.GenericIPAddressField(verbose_name='远程IP地址')), + ('report_type', + models.SmallIntegerField(choices=[(0, '侵权'), (1, '色情'), (2, '赌博'), (3, '欺诈'), (4, '暴力'), (5, '其他')], + default=5, verbose_name='举报类型')), + ('report_reason', models.CharField(max_length=512, verbose_name='举报详情')), + ('email', models.CharField(max_length=64, verbose_name='联系方式')), + ('username', models.CharField(max_length=64, verbose_name='姓名')), + ('status', models.SmallIntegerField(choices=[(1, '处理中'), (2, '已经处理')], default=1, verbose_name='处理状态')), + ('description', models.CharField(blank=True, default='', max_length=256, verbose_name='备注')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='访问时间')), + ('app_id', + models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.apps', + verbose_name='应用信息')), + ], + options={ + 'verbose_name': '应用举报信息', + 'verbose_name_plural': '应用举报信息', + }, + ), migrations.CreateModel( name='AppReleaseInfo', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('is_master', models.BooleanField(default=True, verbose_name='是否master版本')), ( - 'release_id', - models.CharField(db_index=True, max_length=64, unique=True, verbose_name='release 版本id')), - ('build_version', models.CharField(blank=True, max_length=16, verbose_name='build版本')), - ('app_version', models.CharField(blank=True, max_length=16, verbose_name='app版本')), + 'release_id', models.CharField(db_index=True, max_length=64, unique=True, verbose_name='release 版本id')), + ('build_version', models.CharField(blank=True, max_length=64, verbose_name='build版本')), + ('app_version', models.CharField(blank=True, max_length=64, verbose_name='app版本')), ('release_type', models.SmallIntegerField(choices=[(0, 'android'), (1, 'adhoc'), (2, 'Inhouse'), (3, 'unknown')], default=0, verbose_name='版本类型')), @@ -509,7 +417,7 @@ class Migration(migrations.Migration): models.CharField(blank=True, default='', max_length=128, null=True, verbose_name='企业签名')), ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), ('app_id', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Apps', verbose_name='属于哪个APP')), + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.apps', verbose_name='属于哪个APP')), ], options={ 'verbose_name': '应用详情', @@ -519,7 +427,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='userinfo', name='default_domain_name', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.DomainCnameInfo', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.domaincnameinfo', verbose_name='默认下载页域名'), ), migrations.AddField( @@ -534,7 +442,7 @@ class Migration(migrations.Migration): model_name='userinfo', name='storage', field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, - related_name='app_storage', to='api.AppStorage', verbose_name='存储'), + related_name='app_storage', to='api.appstorage', verbose_name='存储'), ), migrations.AddField( model_name='userinfo', @@ -547,21 +455,13 @@ class Migration(migrations.Migration): model_name='usercertificationinfo', index=models.Index(fields=['card'], name='api_usercer_card_246743_idx'), ), - migrations.AlterUniqueTogether( - name='udidsyncdeveloper', - unique_together={('udid', 'developerid')}, - ), - migrations.AlterUniqueTogether( - name='developerdevicesid', - unique_together={('did', 'developerid', 'app_id')}, - ), - migrations.AlterUniqueTogether( - name='developerappid', - unique_together={('aid', 'developerid', 'app_id')}, + migrations.AddIndex( + model_name='useraddisplayinfo', + index=models.Index(fields=['ad_name', 'user_id'], name='api_useradd_ad_name_4ea10e_idx'), ), migrations.AlterUniqueTogether( - name='appudid', - unique_together={('app_id', 'udid')}, + name='useraddisplayinfo', + unique_together={('ad_name', 'user_id')}, ), migrations.AddIndex( model_name='appscreenshot', @@ -575,10 +475,4 @@ class Migration(migrations.Migration): model_name='apps', index=models.Index(fields=['id', 'user_id', 'type'], name='api_apps_id_226a6b_idx'), ), - migrations.AlterUniqueTogether( - name='appiosdeveloperinfo', - unique_together={('user_id', 'issuer_id')}, - ), - migrations.RunPython(add_default_price), - migrations.RunPython(add_default_domain_cname), ] diff --git a/fir_ser/api/migrations/0002_auto_20210607_1743.py b/fir_ser/api/migrations/0002_auto_20210607_1743.py deleted file mode 100644 index b289017..0000000 --- a/fir_ser/api/migrations/0002_auto_20210607_1743.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-07 17:43 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='userinfo', - name='first_name', - field=models.CharField(blank=True, max_length=150, verbose_name='first name'), - ), - migrations.AlterField( - model_name='userinfo', - name='supersign_active', - field=models.BooleanField(default=True, verbose_name='配置超级签,默认关闭'), - ), - ] diff --git a/fir_ser/api/migrations/0002_auto_20220215_2129.py b/fir_ser/api/migrations/0002_auto_20220215_2129.py new file mode 100644 index 0000000..924cd51 --- /dev/null +++ b/fir_ser/api/migrations/0002_auto_20220215_2129.py @@ -0,0 +1,68 @@ +# Generated by Django 3.2.3 on 2022-02-15 21:29 + +from django.conf import settings +from django.db import migrations + +price_info_list = [ + { + "name": "1k_times", + "title": "1k_times", + "description": "1k_times", + "price": 2500, + "package_size": 1000, + "download_count_gift": 100, + "is_enable": True, + }, + { + "name": "10k_times", + "title": "10k_times", + "description": "10k_times", + "price": 22000, + "package_size": 10000, + "download_count_gift": 800, + "is_enable": True, + }, + { + "name": "100k_times", + "title": "100k_times", + "description": "100k_times", + "price": 200000, + "package_size": 100000, + "download_count_gift": 8000, + "is_enable": True, + }, +] +WEB_DOMAIN = settings.WEB_DOMAIN.split('//')[1] +domain_cname_info_list = [ + { + "domain_record": WEB_DOMAIN, + "ip_address": WEB_DOMAIN, + "is_enable": True, + "is_system": True, + "is_https": True if settings.WEB_DOMAIN.startswith('https') else False, + "description": f"默认下载页域名 {WEB_DOMAIN}", + }, +] + + +def add_default_price(apps, schema_editor): + for price in price_info_list: + price_model = apps.get_model('api', 'Price') + price_model.objects.create(**price) + + +def add_default_domain_cname(apps, schema_editor): + for domain_cname_info in domain_cname_info_list: + domain_cname_info_model = apps.get_model('api', 'DomainCnameInfo') + domain_cname_info_model.objects.create(**domain_cname_info) + + +class Migration(migrations.Migration): + dependencies = [ + ('api', '0001_initial'), + ] + + operations = [ + migrations.RunPython(add_default_price), + migrations.RunPython(add_default_domain_cname) + ] diff --git a/fir_ser/api/migrations/0003_apps_new_bundle_name.py b/fir_ser/api/migrations/0003_apps_new_bundle_name.py deleted file mode 100644 index 72d10d5..0000000 --- a/fir_ser/api/migrations/0003_apps_new_bundle_name.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.3 on 2021-06-24 11:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0002_auto_20210607_1743'), - ] - - operations = [ - migrations.AddField( - model_name='apps', - name='new_bundle_name', - field=models.CharField(blank=True, help_text='应用新名称', max_length=64, null=True, - verbose_name='new_bundle_name'), - ), - ] diff --git a/fir_ser/api/migrations/0004_auto_20210705_1819.py b/fir_ser/api/migrations/0004_auto_20210705_1819.py deleted file mode 100644 index 5ce63cf..0000000 --- a/fir_ser/api/migrations/0004_auto_20210705_1819.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.2.3 on 2021-07-05 18:19 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0003_apps_new_bundle_name'), - ] - - operations = [ - migrations.AlterField( - model_name='appreleaseinfo', - name='app_version', - field=models.CharField(blank=True, max_length=64, verbose_name='app版本'), - ), - migrations.AlterField( - model_name='appreleaseinfo', - name='build_version', - field=models.CharField(blank=True, max_length=64, verbose_name='build版本'), - ), - ] diff --git a/fir_ser/api/migrations/0005_thirdwechatuserinfo.py b/fir_ser/api/migrations/0005_thirdwechatuserinfo.py deleted file mode 100644 index a7a2a11..0000000 --- a/fir_ser/api/migrations/0005_thirdwechatuserinfo.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.2.3 on 2021-09-07 19:18 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0004_auto_20210705_1819'), - ] - - operations = [ - migrations.CreateModel( - name='ThirdWeChatUserInfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('openid', models.CharField(max_length=64, unique=True, verbose_name='普通用户的标识,对当前公众号唯一')), - ('nickname', models.CharField(blank=True, max_length=64, verbose_name='昵称')), - ('sex', models.SmallIntegerField(default=0, help_text='值为1时是男性,值为2时是女性,值为0时是未知', verbose_name='性别')), - ('subscribe_time', models.BigIntegerField(verbose_name='订阅时间')), - ('head_img_url', models.CharField(blank=True, max_length=256, null=True, verbose_name='用户头像')), - ('address', models.CharField(blank=True, max_length=128, null=True, verbose_name='地址')), - ('subscribe', models.BooleanField(default=0, verbose_name='是否订阅公众号')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='授权时间')), - ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, - verbose_name='用户ID')), - ], - ), - ] diff --git a/fir_ser/api/migrations/0006_auto_20210907_2100.py b/fir_ser/api/migrations/0006_auto_20210907_2100.py deleted file mode 100644 index 635bd9e..0000000 --- a/fir_ser/api/migrations/0006_auto_20210907_2100.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.3 on 2021-09-07 21:00 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0005_thirdwechatuserinfo'), - ] - - operations = [ - migrations.RemoveField( - model_name='userinfo', - name='qq', - ), - migrations.AlterField( - model_name='userinfo', - name='email', - field=models.EmailField(blank=True, db_index=True, max_length=255, null=True, verbose_name='email address'), - ), - migrations.AlterField( - model_name='userinfo', - name='mobile', - field=models.BigIntegerField(db_index=True, help_text='用于手机验证码登录', null=True, verbose_name='手机'), - ), - ] diff --git a/fir_ser/api/migrations/0007_auto_20210909_0919.py b/fir_ser/api/migrations/0007_auto_20210909_0919.py deleted file mode 100644 index daab0b8..0000000 --- a/fir_ser/api/migrations/0007_auto_20210909_0919.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.3 on 2021-09-09 09:19 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0006_auto_20210907_2100'), - ] - - operations = [ - migrations.RemoveField( - model_name='udidsyncdeveloper', - name='platform', - ), - migrations.AddField( - model_name='udidsyncdeveloper', - name='status', - field=models.BooleanField(default=False, verbose_name='设备在开发者平台状态'), - ), - ] diff --git a/fir_ser/api/migrations/0008_remove_appiosdeveloperinfo_use_number.py b/fir_ser/api/migrations/0008_remove_appiosdeveloperinfo_use_number.py deleted file mode 100644 index d0d84f3..0000000 --- a/fir_ser/api/migrations/0008_remove_appiosdeveloperinfo_use_number.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.2.3 on 2021-09-15 15:41 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0007_auto_20210909_0919'), - ] - - operations = [ - migrations.RemoveField( - model_name='appiosdeveloperinfo', - name='use_number', - ), - ] diff --git a/fir_ser/api/migrations/0009_userdomaininfo_domain_type.py b/fir_ser/api/migrations/0009_userdomaininfo_domain_type.py deleted file mode 100644 index 683ceaf..0000000 --- a/fir_ser/api/migrations/0009_userdomaininfo_domain_type.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.3 on 2021-09-18 15:17 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0008_remove_appiosdeveloperinfo_use_number'), - ] - - operations = [ - migrations.AddField( - model_name='userdomaininfo', - name='domain_type', - field=models.SmallIntegerField(choices=[(0, '下载码域名'), (1, '预览下载域名')], default=1, - help_text='0 表示下载码域名,扫描下载码域名,会自动跳转到预览域名', verbose_name='域名类型'), - ), - ] diff --git a/fir_ser/api/migrations/0010_alter_userdomaininfo_domain_type.py b/fir_ser/api/migrations/0010_alter_userdomaininfo_domain_type.py deleted file mode 100644 index b9adfb9..0000000 --- a/fir_ser/api/migrations/0010_alter_userdomaininfo_domain_type.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.3 on 2021-09-23 12:47 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0009_userdomaininfo_domain_type'), - ] - - operations = [ - migrations.AlterField( - model_name='userdomaininfo', - name='domain_type', - field=models.SmallIntegerField(choices=[(0, '下载码域名'), (1, '下载页域名'), (2, '应用专用域名')], default=1, - help_text='0 表示下载码域名,扫描下载码域名,会自动跳转到预览域名', verbose_name='域名类型'), - ), - ] diff --git a/fir_ser/api/migrations/0011_appudid_is_download.py b/fir_ser/api/migrations/0011_appudid_is_download.py deleted file mode 100644 index 00ff69a..0000000 --- a/fir_ser/api/migrations/0011_appudid_is_download.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.3 on 2021-09-28 15:40 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0010_alter_userdomaininfo_domain_type'), - ] - - operations = [ - migrations.AddField( - model_name='appudid', - name='is_download', - field=models.BooleanField(default=False, verbose_name='描述文件是否已经下载'), - ), - ] diff --git a/fir_ser/api/migrations/0012_useraddisplayinfo.py b/fir_ser/api/migrations/0012_useraddisplayinfo.py deleted file mode 100644 index fcc6a4e..0000000 --- a/fir_ser/api/migrations/0012_useraddisplayinfo.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 3.2.3 on 2021-10-14 14:35 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0011_appudid_is_download'), - ] - - operations = [ - migrations.CreateModel( - name='UserAdDisplayInfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('ad_uri', models.CharField(max_length=256, verbose_name='广告跳转地址')), - ('ad_pic', models.CharField(help_text='像素最高80px', max_length=256, verbose_name='广告图片地址')), - ('weight', models.IntegerField(default=10, verbose_name='广告展示权重')), - ('description', models.TextField(blank=True, default='', null=True, verbose_name='描述信息')), - ('is_enable', models.BooleanField(default=False, verbose_name='广告开启状态')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='广告创建时间')), - ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, - verbose_name='用户ID')), - ], - options={ - 'verbose_name': '用户自定义广告', - 'verbose_name_plural': '用户自定义广告', - }, - ), - ] diff --git a/fir_ser/api/migrations/0013_auto_20211014_1617.py b/fir_ser/api/migrations/0013_auto_20211014_1617.py deleted file mode 100644 index 84ceb6d..0000000 --- a/fir_ser/api/migrations/0013_auto_20211014_1617.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.2.3 on 2021-10-14 16:17 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0012_useraddisplayinfo'), - ] - - operations = [ - migrations.AddField( - model_name='useraddisplayinfo', - name='ad_name', - field=models.CharField(default='xx', max_length=256, verbose_name='广告名称'), - preserve_default=False, - ), - migrations.AddIndex( - model_name='useraddisplayinfo', - index=models.Index(fields=['ad_name', 'user_id'], name='api_useradd_ad_name_4ea10e_idx'), - ), - ] diff --git a/fir_ser/api/migrations/0014_alter_useraddisplayinfo_unique_together.py b/fir_ser/api/migrations/0014_alter_useraddisplayinfo_unique_together.py deleted file mode 100644 index bcada00..0000000 --- a/fir_ser/api/migrations/0014_alter_useraddisplayinfo_unique_together.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.2.3 on 2021-10-14 16:18 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0013_auto_20211014_1617'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='useraddisplayinfo', - unique_together={('ad_name', 'user_id')}, - ), - ] diff --git a/fir_ser/api/migrations/0015_iosdeveloperpublicpoolbill_remoteclientinfo.py b/fir_ser/api/migrations/0015_iosdeveloperpublicpoolbill_remoteclientinfo.py deleted file mode 100644 index 987cedd..0000000 --- a/fir_ser/api/migrations/0015_iosdeveloperpublicpoolbill_remoteclientinfo.py +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by Django 3.2.3 on 2021-10-30 10:57 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0014_alter_useraddisplayinfo_unique_together'), - ] - - operations = [ - migrations.CreateModel( - name='RemoteClientInfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('remote_addr', models.GenericIPAddressField(verbose_name='远程IP地址')), - ('user_agent', models.CharField(max_length=512, verbose_name='客户端agent')), - ('method', models.CharField(max_length=16, verbose_name='请求方式')), - ('uri_info', models.CharField(max_length=256, verbose_name='访问的URI')), - ('a_domain', models.CharField(max_length=128, verbose_name='前端域名')), - ('description', models.CharField(max_length=256, verbose_name='访问描述')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='访问时间')), - ], - options={ - 'verbose_name': '客户端访问记录', - 'verbose_name_plural': '客户端访问记录', - }, - ), - migrations.CreateModel( - name='IosDeveloperPublicPoolBill', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('action', models.SmallIntegerField(choices=[(0, '消费'), (1, '充值'), (2, '转账')], default=0, - help_text='0 消费 1 充值 2 转账', verbose_name='资金类型')), - ('number', models.IntegerField(default=1, verbose_name='消耗次数')), - ('app_info', models.JSONField(blank=True, max_length=256, null=True, verbose_name='属于哪个APP')), - ('udid_info', models.JSONField(blank=True, max_length=256, null=True, verbose_name='设备id信息')), - ('developer_info', models.JSONField(blank=True, max_length=256, null=True, verbose_name='开发者信息')), - ('description', models.CharField(blank=True, default='', max_length=128, verbose_name='操作描述')), - ('remote_addr', models.GenericIPAddressField(verbose_name='远程IP地址')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')), - ('to_user_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, - related_name='to_user_id', to=settings.AUTH_USER_MODEL, - verbose_name='用户ID')), - ('udid_sync_info', - models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, - to='api.udidsyncdeveloper', verbose_name='关联同步设备信息')), - ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='org_user_id', - to=settings.AUTH_USER_MODEL, verbose_name='用户ID')), - ], - options={ - 'verbose_name': '资金流转账单', - 'verbose_name_plural': '资金流转账单', - }, - ), - ] diff --git a/fir_ser/api/migrations/0016_alter_appudid_udid.py b/fir_ser/api/migrations/0016_alter_appudid_udid.py deleted file mode 100644 index 7d9e024..0000000 --- a/fir_ser/api/migrations/0016_alter_appudid_udid.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.3 on 2021-10-30 11:52 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0015_iosdeveloperpublicpoolbill_remoteclientinfo'), - ] - - operations = [ - migrations.AlterField( - model_name='appudid', - name='udid', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.udidsyncdeveloper', - verbose_name='udid唯一标识'), - ), - ] diff --git a/fir_ser/api/migrations/0017_developerappid_profile_id.py b/fir_ser/api/migrations/0017_developerappid_profile_id.py deleted file mode 100644 index 215d605..0000000 --- a/fir_ser/api/migrations/0017_developerappid_profile_id.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.3 on 2021-11-02 17:44 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0016_alter_appudid_udid'), - ] - - operations = [ - migrations.AddField( - model_name='developerappid', - name='profile_id', - field=models.CharField(blank=True, max_length=64, null=True), - ), - ] diff --git a/fir_ser/api/migrations/0018_devicequeue.py b/fir_ser/api/migrations/0018_devicequeue.py deleted file mode 100644 index 1b8d7d3..0000000 --- a/fir_ser/api/migrations/0018_devicequeue.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.3 on 2021-11-03 14:25 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0017_developerappid_profile_id'), - ] - - operations = [ - migrations.CreateModel( - name='DeviceQueue', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('udid', models.CharField(db_index=True, max_length=64, verbose_name='udid唯一标识')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='访问时间')), - ('app_id', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.apps', verbose_name='应用id')), - ('developerid', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.appiosdeveloperinfo', - verbose_name='所使用苹果开发者账户')), - ], - ), - ] diff --git a/fir_ser/api/migrations/0019_iosdeveloperpublicpoolbill_udid.py b/fir_ser/api/migrations/0019_iosdeveloperpublicpoolbill_udid.py deleted file mode 100644 index 3ed4bbf..0000000 --- a/fir_ser/api/migrations/0019_iosdeveloperpublicpoolbill_udid.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.3 on 2021-11-03 17:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0018_devicequeue'), - ] - - operations = [ - migrations.AddField( - model_name='iosdeveloperpublicpoolbill', - name='udid', - field=models.CharField(blank=True, max_length=64, null=True, verbose_name='设备udid'), - ), - ] diff --git a/fir_ser/api/migrations/0020_auto_20211104_1118.py b/fir_ser/api/migrations/0020_auto_20211104_1118.py deleted file mode 100644 index bef44ef..0000000 --- a/fir_ser/api/migrations/0020_auto_20211104_1118.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 3.2.3 on 2021-11-04 11:18 - -from django.db import migrations, models - -import common.base.daobase - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0019_iosdeveloperpublicpoolbill_udid'), - ] - - operations = [ - migrations.RemoveField( - model_name='iosdeveloperpublicpoolbill', - name='udid_info', - ), - migrations.AddField( - model_name='iosdeveloperpublicpoolbill', - name='product', - field=models.CharField(blank=True, max_length=64, null=True, verbose_name='设备udid'), - ), - migrations.AddField( - model_name='iosdeveloperpublicpoolbill', - name='version', - field=models.CharField(blank=True, max_length=64, null=True, verbose_name='设备udid'), - ), - migrations.AlterField( - model_name='appiosdeveloperinfo', - name='p8key', - field=common.base.daobase.AESCharField(max_length=512, verbose_name='p8key'), - ), - migrations.AlterField( - model_name='appstorage', - name='secret_key', - field=common.base.daobase.AESCharField(blank=True, max_length=128, null=True, verbose_name='存储访问secret'), - ), - ] diff --git a/fir_ser/api/migrations/0021_appreportinfo.py b/fir_ser/api/migrations/0021_appreportinfo.py deleted file mode 100644 index f3f050c..0000000 --- a/fir_ser/api/migrations/0021_appreportinfo.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 3.2.3 on 2021-11-05 17:12 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0020_auto_20211104_1118'), - ] - - operations = [ - migrations.CreateModel( - name='AppReportInfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('app_name', models.CharField(blank=True, max_length=32, null=True, verbose_name='应用名称')), - ('bundle_id', models.CharField(blank=True, max_length=64, verbose_name='bundle id')), - ('remote_addr', models.GenericIPAddressField(verbose_name='远程IP地址')), - ('report_type', - models.SmallIntegerField(choices=[(0, '侵权'), (1, '色情'), (2, '赌博'), (3, '欺诈'), (4, '暴力'), (5, '其他')], - default=5, verbose_name='举报类型')), - ('report_reason', models.CharField(max_length=512, verbose_name='举报详情')), - ('email', models.CharField(max_length=64, verbose_name='联系方式')), - ('username', models.CharField(max_length=64, verbose_name='姓名')), - ('status', models.SmallIntegerField(choices=[(1, '处理中'), (2, '已经处理')], default=1, verbose_name='处理状态')), - ('description', models.CharField(blank=True, default='', max_length=256, verbose_name='备注')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='访问时间')), - ('app_id', - models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.apps', - verbose_name='应用信息')), - ], - options={ - 'verbose_name': '应用举报信息', - 'verbose_name_plural': '应用举报信息', - }, - ), - ] diff --git a/fir_ser/api/migrations/0022_iosdeveloperpublicpoolbill_app_id.py b/fir_ser/api/migrations/0022_iosdeveloperpublicpoolbill_app_id.py deleted file mode 100644 index 84f5dff..0000000 --- a/fir_ser/api/migrations/0022_iosdeveloperpublicpoolbill_app_id.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.3 on 2021-11-06 13:04 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0021_appreportinfo'), - ] - - operations = [ - migrations.AddField( - model_name='iosdeveloperpublicpoolbill', - name='app_id', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.apps', - verbose_name='属于哪个APP'), - ), - ] diff --git a/fir_ser/api/migrations/0023_remove_appudid_binary_file.py b/fir_ser/api/migrations/0023_remove_appudid_binary_file.py deleted file mode 100644 index 65548a8..0000000 --- a/fir_ser/api/migrations/0023_remove_appudid_binary_file.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.2.3 on 2021-11-06 16:14 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0022_iosdeveloperpublicpoolbill_app_id'), - ] - - operations = [ - migrations.RemoveField( - model_name='appudid', - name='binary_file', - ), - ] diff --git a/fir_ser/api/migrations/0024_auto_20211108_1755.py b/fir_ser/api/migrations/0024_auto_20211108_1755.py deleted file mode 100644 index 6d95cd7..0000000 --- a/fir_ser/api/migrations/0024_auto_20211108_1755.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.3 on 2021-11-08 17:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0023_remove_appudid_binary_file'), - ] - - operations = [ - migrations.AddField( - model_name='token', - name='remote_addr', - field=models.GenericIPAddressField(blank=True, null=True, verbose_name='远程IP地址'), - ), - migrations.AlterField( - model_name='order', - name='order_type', - field=models.SmallIntegerField(choices=[(0, '用户下单'), (1, '后台充值'), (2, '系统赠送')], default=0, - verbose_name='订单类型'), - ), - ] diff --git a/fir_ser/api/migrations/0025_delete_devicequeue.py b/fir_ser/api/migrations/0025_delete_devicequeue.py deleted file mode 100644 index 5b64b26..0000000 --- a/fir_ser/api/migrations/0025_delete_devicequeue.py +++ /dev/null @@ -1,15 +0,0 @@ -# Generated by Django 3.2.3 on 2021-11-16 21:23 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0024_auto_20211108_1755'), - ] - - operations = [ - migrations.DeleteModel( - name='DeviceQueue', - ), - ] diff --git a/fir_ser/api/migrations/0026_appledevelopertoappuse.py b/fir_ser/api/migrations/0026_appledevelopertoappuse.py deleted file mode 100644 index 138e82b..0000000 --- a/fir_ser/api/migrations/0026_appledevelopertoappuse.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.2.3 on 2021-12-13 16:43 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0025_delete_devicequeue'), - ] - - operations = [ - migrations.CreateModel( - name='AppleDeveloperToAppUse', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('usable_number', models.IntegerField(default=100, verbose_name='可使用设备数')), - ('description', models.CharField(blank=True, default='', max_length=256, verbose_name='备注')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')), - ('app_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.apps')), - ('developerid', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.appiosdeveloperinfo')), - ], - options={ - 'verbose_name': '开发者专属于应用', - 'verbose_name_plural': '开发者专属于应用', - 'unique_together': {('app_id', 'developerid')}, - }, - ), - ] diff --git a/fir_ser/api/migrations/0027_appiosdeveloperinfo_app_limit_number.py b/fir_ser/api/migrations/0027_appiosdeveloperinfo_app_limit_number.py deleted file mode 100644 index 294f65f..0000000 --- a/fir_ser/api/migrations/0027_appiosdeveloperinfo_app_limit_number.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.3 on 2021-12-16 10:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0026_appledevelopertoappuse'), - ] - - operations = [ - migrations.AddField( - model_name='appiosdeveloperinfo', - name='app_limit_number', - field=models.IntegerField(default=100, verbose_name='可分配应用数,最大160'), - ), - ] diff --git a/fir_ser/api/migrations/0028_auto_20211228_1454.py b/fir_ser/api/migrations/0028_auto_20211228_1454.py deleted file mode 100644 index 8d0fd06..0000000 --- a/fir_ser/api/migrations/0028_auto_20211228_1454.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.2.3 on 2021-12-28 14:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0027_appiosdeveloperinfo_app_limit_number'), - ] - - operations = [ - migrations.RemoveField( - model_name='appiosdeveloperinfo', - name='is_actived', - ), - migrations.AddField( - model_name='appiosdeveloperinfo', - name='status', - field=models.SmallIntegerField( - choices=[(0, '未激活'), (1, '已激活'), (2, '协议待同意'), (3, '维护中'), (4, '证书过期'), (5, '状态异常')], default=0, - verbose_name='账户状态'), - ), - migrations.AddField( - model_name='userdomaininfo', - name='is_https', - field=models.BooleanField(default=False, verbose_name='是否支持HTTPS'), - ), - migrations.AddField( - model_name='userdomaininfo', - name='weight', - field=models.IntegerField(default=10, verbose_name='下载页域名展示权重'), - ), - ] diff --git a/fir_ser/api/migrations/0029_auto_20220102_1522.py b/fir_ser/api/migrations/0029_auto_20220102_1522.py deleted file mode 100644 index b839e7b..0000000 --- a/fir_ser/api/migrations/0029_auto_20220102_1522.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2.3 on 2022-01-02 15:22 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0028_auto_20211228_1454'), - ] - - operations = [ - migrations.AddField( - model_name='appiosdeveloperinfo', - name='clean_status', - field=models.BooleanField(default=False, verbose_name='清理是否同时禁用设备ID'), - ), - migrations.AlterField( - model_name='appiosdeveloperinfo', - name='status', - field=models.SmallIntegerField( - choices=[(-1, '疑似被封'), (0, '未激活'), (1, '已激活'), (2, '协议待同意'), (3, '维护中'), (4, '证书过期'), (5, '状态异常')], - default=0, verbose_name='账户状态'), - ), - ] diff --git a/fir_ser/api/migrations/0030_auto_20220203_1545.py b/fir_ser/api/migrations/0030_auto_20220203_1545.py deleted file mode 100644 index 5b9b0de..0000000 --- a/fir_ser/api/migrations/0030_auto_20220203_1545.py +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by Django 3.2.3 on 2022-02-03 15:45 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0029_auto_20220102_1522'), - ] - - operations = [ - migrations.AlterModelOptions( - name='iosdeveloperpublicpoolbill', - options={'verbose_name': '设备消耗账单', 'verbose_name_plural': '设备消耗账单'}, - ), - migrations.RemoveField( - model_name='iosdeveloperpublicpoolbill', - name='action', - ), - migrations.RemoveField( - model_name='iosdeveloperpublicpoolbill', - name='to_user_id', - ), - migrations.AlterField( - model_name='iosdeveloperpublicpoolbill', - name='user_id', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, - verbose_name='用户ID'), - ), - migrations.CreateModel( - name='IosDeveloperBill', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('status', models.SmallIntegerField(choices=[(0, '失效'), (1, '撤回'), (2, '转账')], default=0, - help_text='0 失效 1 撤回 2 转账', verbose_name='状态')), - ('number', models.IntegerField(default=1, verbose_name='设备数量')), - ('description', models.CharField(blank=True, default='', max_length=128, verbose_name='操作描述')), - ('remote_addr', models.GenericIPAddressField(verbose_name='远程IP地址')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')), - ('to_user_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, - related_name='to_user_id', to=settings.AUTH_USER_MODEL, - verbose_name='用户ID')), - ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='org_user_id', - to=settings.AUTH_USER_MODEL, verbose_name='用户ID')), - ], - options={ - 'verbose_name': '设备划转账单', - 'verbose_name_plural': '设备划转账单', - }, - ), - ] diff --git a/fir_ser/api/migrations/0031_auto_20220204_0906.py b/fir_ser/api/migrations/0031_auto_20220204_0906.py deleted file mode 100644 index 9ad590f..0000000 --- a/fir_ser/api/migrations/0031_auto_20220204_0906.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.3 on 2022-02-04 09:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0030_auto_20220203_1545'), - ] - - operations = [ - migrations.AddField( - model_name='iosdeveloperbill', - name='updated_time', - field=models.DateTimeField(auto_now=True, verbose_name='更新时间'), - ), - migrations.AlterField( - model_name='iosdeveloperbill', - name='status', - field=models.SmallIntegerField(choices=[(0, '失效'), (1, '已撤回'), (2, '成功')], default=0, - help_text='0 失效 1 撤回 2 转账', verbose_name='状态'), - ), - ] diff --git a/fir_ser/api/migrations/0032_systemconfig.py b/fir_ser/api/migrations/0032_systemconfig.py deleted file mode 100644 index 43b495c..0000000 --- a/fir_ser/api/migrations/0032_systemconfig.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.3 on 2022-02-04 11:25 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0031_auto_20220204_0906'), - ] - - operations = [ - migrations.CreateModel( - name='SystemConfig', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('key', models.CharField(max_length=256, unique=True, verbose_name='配置名称')), - ('value', models.CharField(max_length=512, verbose_name='配置值')), - ('description', models.CharField(blank=True, default='', max_length=256, verbose_name='备注')), - ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), - ], - options={ - 'verbose_name': '系统配置项', - 'verbose_name_plural': '系统配置项', - }, - ), - ] diff --git a/fir_ser/api/migrations/0033_appiosdeveloperinfo_auto_check.py b/fir_ser/api/migrations/0033_appiosdeveloperinfo_auto_check.py deleted file mode 100644 index 38c42e1..0000000 --- a/fir_ser/api/migrations/0033_appiosdeveloperinfo_auto_check.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.3 on 2022-02-05 09:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0032_systemconfig'), - ] - - operations = [ - migrations.AddField( - model_name='appiosdeveloperinfo', - name='auto_check', - field=models.BooleanField(default=False, verbose_name='是否自动检测开发者状态'), - ), - ] diff --git a/fir_ser/api/migrations/0034_auto_20220208_0941.py b/fir_ser/api/migrations/0034_auto_20220208_0941.py deleted file mode 100644 index b8cd9da..0000000 --- a/fir_ser/api/migrations/0034_auto_20220208_0941.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 3.2.3 on 2022-02-08 09:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0033_appiosdeveloperinfo_auto_check'), - ] - - operations = [ - migrations.RemoveField( - model_name='appudid', - name='is_download', - ), - migrations.RemoveField( - model_name='appudid', - name='is_signed', - ), - migrations.AddField( - model_name='apps', - name='change_auto_sign', - field=models.BooleanField(default=False, verbose_name='签名相关的数据更新自动签名'), - ), - migrations.AddField( - model_name='appudid', - name='sign_status', - field=models.SmallIntegerField( - choices=[(0, '新设备入库准备'), (1, '设备ID已经注册'), (2, 'bundelid已经注册'), (3, '描述文件已经下载'), (4, '已经完成签名打包')], - default=0, verbose_name='签名状态'), - ), - ] diff --git a/fir_ser/api/migrations/0035_auto_20220214_2042.py b/fir_ser/api/migrations/0035_auto_20220214_2042.py deleted file mode 100644 index f8c7eab..0000000 --- a/fir_ser/api/migrations/0035_auto_20220214_2042.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 3.2.3 on 2022-02-14 20:42 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0034_auto_20220208_0941'), - ] - - operations = [ - migrations.AddField( - model_name='systemconfig', - name='enable', - field=models.BooleanField(default=True, verbose_name='是否启用该配置项'), - ), - migrations.AlterField( - model_name='systemconfig', - name='key', - field=models.CharField(max_length=128, unique=True, verbose_name='配置名称'), - ), - migrations.AlterField( - model_name='systemconfig', - name='value', - field=models.TextField(max_length=10240, verbose_name='配置值'), - ), - ] diff --git a/fir_ser/common/core/exception.py b/fir_ser/common/core/exception.py index c03de54..4d4c965 100644 --- a/fir_ser/common/core/exception.py +++ b/fir_ser/common/core/exception.py @@ -7,7 +7,7 @@ import logging from rest_framework.views import exception_handler -from admin.utils.utils import ApiResponse +from common.core.response import ApiResponse logger = logging.getLogger(__file__) diff --git a/fir_ser/config.py b/fir_ser/config.py index 5093bf9..e80b591 100644 --- a/fir_ser/config.py +++ b/fir_ser/config.py @@ -59,7 +59,7 @@ class DBCONF(object): port = '3306' password = 'KGzKjZpWBp4R4RSa' user = 'flyuser' - name = 'flyapp' + name = 'flyappnew' class CACHECONF(object): diff --git a/fir_ser/xsign/migrations/0001_initial.py b/fir_ser/xsign/migrations/0001_initial.py new file mode 100644 index 0000000..10275a1 --- /dev/null +++ b/fir_ser/xsign/migrations/0001_initial.py @@ -0,0 +1,235 @@ +# Generated by Django 3.2.3 on 2022-02-15 21:22 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + +import common.base.daobase + + +class Migration(migrations.Migration): + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('api', '__first__'), + ] + + operations = [ + migrations.CreateModel( + name='AppIOSDeveloperInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('issuer_id', models.CharField(max_length=64, verbose_name='标识创建认证令牌的发放者')), + ('private_key_id', models.CharField(max_length=64, verbose_name='密钥 ID')), + ('p8key', common.base.daobase.AESCharField(max_length=512, verbose_name='p8key')), + ('certid', models.CharField(blank=True, max_length=64, null=True, verbose_name='超级签名自动创建证书ID')), + ('usable_number', models.IntegerField(default=100, verbose_name='可使用设备数')), + ('app_limit_number', models.IntegerField(default=100, verbose_name='可分配应用数,最大160')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), + ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), + ('cert_expire_time', models.DateTimeField(blank=True, null=True, verbose_name='证书过期时间')), + ('description', models.TextField(blank=True, default='', null=True, verbose_name='备注')), + ('auth_type', models.SmallIntegerField(choices=[(0, 'p8key认证')], default=0, verbose_name='认证类型')), + ('status', models.SmallIntegerField( + choices=[(-1, '疑似被封'), (0, '未激活'), (1, '已激活'), (2, '协议待同意'), (3, '维护中'), (4, '证书过期'), (5, '状态异常')], + default=0, verbose_name='账户状态')), + ('clean_status', models.BooleanField(default=False, verbose_name='清理是否同时禁用设备ID')), + ('auto_check', models.BooleanField(default=False, verbose_name='是否自动检测开发者状态')), + ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, + verbose_name='用户ID')), + ], + options={ + 'verbose_name': '苹果开发者账户', + 'verbose_name_plural': '苹果开发者账户', + 'unique_together': {('user_id', 'issuer_id')}, + }, + ), + migrations.CreateModel( + name='UDIDsyncDeveloper', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('udid', models.CharField(db_index=True, max_length=64, verbose_name='udid唯一标识')), + ('product', models.CharField(blank=True, max_length=64, null=True, verbose_name='产品')), + ('serial', models.CharField(blank=True, max_length=64, null=True, verbose_name='序列号')), + ('version', models.CharField(blank=True, max_length=64, null=True, verbose_name='型号')), + ('status', models.BooleanField(default=False, verbose_name='设备在开发者平台状态')), + ('developerid', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xsign.appiosdeveloperinfo', + verbose_name='所使用苹果开发者账户')), + ], + options={ + 'verbose_name': 'iOS开发平台同步设备信息', + 'verbose_name_plural': 'iOS开发平台同步设备信息', + 'unique_together': {('udid', 'developerid')}, + }, + ), + migrations.CreateModel( + name='IosDeveloperPublicPoolBill', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('number', models.IntegerField(default=1, verbose_name='消耗次数')), + ('app_info', models.JSONField(blank=True, max_length=256, null=True, verbose_name='属于哪个APP')), + ('udid', models.CharField(blank=True, max_length=64, null=True, verbose_name='设备udid')), + ('product', models.CharField(blank=True, max_length=64, null=True, verbose_name='设备udid')), + ('version', models.CharField(blank=True, max_length=64, null=True, verbose_name='设备udid')), + ('developer_info', models.JSONField(blank=True, max_length=256, null=True, verbose_name='开发者信息')), + ('description', models.CharField(blank=True, default='', max_length=128, verbose_name='操作描述')), + ('remote_addr', models.GenericIPAddressField(verbose_name='远程IP地址')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')), + ('app_id', + models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.apps', + verbose_name='属于哪个APP')), + ('udid_sync_info', + models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, + to='xsign.udidsyncdeveloper', verbose_name='关联同步设备信息')), + ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, + verbose_name='用户ID')), + ], + options={ + 'verbose_name': '设备消耗账单', + 'verbose_name_plural': '设备消耗账单', + }, + ), + migrations.CreateModel( + name='IosDeveloperBill', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('status', models.SmallIntegerField(choices=[(0, '失效'), (1, '已撤回'), (2, '成功')], default=0, + help_text='0 失效 1 撤回 2 转账', verbose_name='状态')), + ('number', models.IntegerField(default=1, verbose_name='设备数量')), + ('description', models.CharField(blank=True, default='', max_length=128, verbose_name='操作描述')), + ('remote_addr', models.GenericIPAddressField(verbose_name='远程IP地址')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')), + ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), + ('to_user_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, + related_name='to_user_id', to=settings.AUTH_USER_MODEL, + verbose_name='用户ID')), + ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='org_user_id', + to=settings.AUTH_USER_MODEL, verbose_name='用户ID')), + ], + options={ + 'verbose_name': '设备划转账单', + 'verbose_name_plural': '设备划转账单', + }, + ), + migrations.CreateModel( + name='AppUDID', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('product', models.CharField(blank=True, max_length=64, null=True, verbose_name='产品')), + ('serial', models.CharField(blank=True, max_length=64, null=True, verbose_name='序列号')), + ('version', models.CharField(blank=True, max_length=64, null=True, verbose_name='型号')), + ('imei', models.CharField(blank=True, max_length=64, null=True, verbose_name='型号')), + ('iccid', models.CharField(blank=True, max_length=64, null=True, verbose_name='型号')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), + ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), + ('sign_status', models.SmallIntegerField( + choices=[(0, '新设备入库准备'), (1, '设备ID已经注册'), (2, 'bundelid已经注册'), (3, '描述文件已经下载'), (4, '已经完成签名打包')], + default=0, verbose_name='签名状态')), + ('app_id', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.apps', verbose_name='属于哪个APP')), + ('udid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xsign.udidsyncdeveloper', + verbose_name='udid唯一标识')), + ], + options={ + 'verbose_name': '设备详情', + 'verbose_name_plural': '设备详情', + 'unique_together': {('app_id', 'udid')}, + }, + ), + migrations.CreateModel( + name='APPToDeveloper', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('binary_file', + models.CharField(blank=True, max_length=128, null=True, unique=True, verbose_name='签名包名称')), + ('release_file', models.CharField(blank=True, max_length=128, null=True, verbose_name='源包名称')), + ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), + ('app_id', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.apps', verbose_name='属于哪个APP')), + ('developerid', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xsign.appiosdeveloperinfo', + verbose_name='所使用苹果开发者账户')), + ], + options={ + 'verbose_name': '应用开发者绑定', + 'verbose_name_plural': '应用开发者绑定', + }, + ), + migrations.CreateModel( + name='APPSuperSignUsedInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), + ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), + ('app_id', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.apps', verbose_name='属于哪个APP')), + ('developerid', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xsign.appiosdeveloperinfo', + verbose_name='所使用苹果开发者账户')), + ('udid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xsign.appudid', + verbose_name='所消耗的udid')), + ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, + verbose_name='用户ID')), + ], + options={ + 'verbose_name': '设备使用统计', + 'verbose_name_plural': '设备使用统计', + }, + ), + migrations.CreateModel( + name='DeveloperDevicesID', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('did', models.CharField(max_length=64)), + ('app_id', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.apps', verbose_name='属于哪个APP')), + ('developerid', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xsign.appiosdeveloperinfo', + verbose_name='所使用苹果开发者账户')), + ('udid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xsign.udidsyncdeveloper', + verbose_name='所消耗的udid')), + ], + options={ + 'verbose_name': '超级签Devices id', + 'verbose_name_plural': '超级签Devices id', + 'unique_together': {('did', 'developerid', 'app_id')}, + }, + ), + migrations.CreateModel( + name='DeveloperAppID', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('aid', models.CharField(max_length=64)), + ('profile_id', models.CharField(blank=True, max_length=64, null=True)), + ('app_id', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.apps', verbose_name='属于哪个APP')), + ('developerid', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xsign.appiosdeveloperinfo', + verbose_name='所使用苹果开发者账户')), + ], + options={ + 'verbose_name': '超级签APP id', + 'verbose_name_plural': '超级签APP id', + 'unique_together': {('aid', 'developerid', 'app_id')}, + }, + ), + migrations.CreateModel( + name='AppleDeveloperToAppUse', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('usable_number', models.IntegerField(default=100, verbose_name='可使用设备数')), + ('description', models.CharField(blank=True, default='', max_length=256, verbose_name='备注')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')), + ('app_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.apps')), + ('developerid', + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xsign.appiosdeveloperinfo')), + ], + options={ + 'verbose_name': '开发者专属于应用', + 'verbose_name_plural': '开发者专属于应用', + 'unique_together': {('app_id', 'developerid')}, + }, + ), + ]