From 0ac35618e2a5d922b17214f54cf44ffcb0680a39 Mon Sep 17 00:00:00 2001 From: youngS Date: Sat, 22 May 2021 11:37:20 +0800 Subject: [PATCH] reset db install ........... --- .gitignore | 4 + fir_client/vue.config.js | 16 +- fir_ser/api/migrations/0001_initial.py | 304 ++++++++++++++++-- .../api/migrations/0002_auto_20200503_1120.py | 25 -- fir_ser/api/migrations/0003_apptodeveloper.py | 30 -- .../api/migrations/0004_auto_20200504_2054.py | 21 -- .../0005_apptodeveloper_release_file.py | 17 - .../api/migrations/0006_udidsyncdeveloper.py | 32 -- .../api/migrations/0007_auto_20200520_1153.py | 22 -- .../api/migrations/0008_auto_20200922_1951.py | 17 - .../api/migrations/0009_auto_20200925_2041.py | 27 -- .../api/migrations/0010_userinfo_api_token.py | 17 - .../api/migrations/0011_auto_20210125_1137.py | 22 -- .../api/migrations/0012_auto_20210127_2101.py | 18 -- .../api/migrations/0013_auto_20210128_1815.py | 22 -- .../api/migrations/0014_auto_20210129_1600.py | 36 --- .../api/migrations/0015_auto_20210129_1730.py | 17 - .../0016_developerappid_developerdevicesid.py | 49 --- .../api/migrations/0017_auto_20210131_2108.py | 19 -- .../api/migrations/0018_auto_20210308_1352.py | 22 -- .../api/migrations/0019_auto_20210308_1355.py | 22 -- .../api/migrations/0020_auto_20210308_1453.py | 18 -- .../api/migrations/0021_auto_20210308_1951.py | 23 -- .../0022_appreleaseinfo_distribution_name.py | 17 - .../api/migrations/0023_auto_20210316_1602.py | 31 -- .../api/migrations/0024_auto_20210324_1751.py | 17 - fir_ser/api/migrations/0025_order_price.py | 54 ---- .../api/migrations/0026_auto_20210329_1419.py | 17 - .../api/migrations/0027_auto_20210329_1506.py | 34 -- .../api/migrations/0028_order_created_time.py | 19 -- .../api/migrations/0029_remove_order_date.py | 16 - .../api/migrations/0030_auto_20210329_1755.py | 27 -- .../api/migrations/0031_auto_20210407_2021.py | 51 --- .../migrations/0032_certificationinfo_type.py | 19 -- .../api/migrations/0033_auto_20210407_2045.py | 18 -- .../0034_usercertificationinfo_msg.py | 17 - ...035_usercertificationinfo_reviewed_time.py | 18 -- .../api/migrations/0036_auto_20210409_1512.py | 20 -- .../api/migrations/0037_auto_20210412_1559.py | 37 --- .../api/migrations/0038_auto_20210412_1601.py | 17 - .../api/migrations/0039_auto_20210412_1759.py | 17 - .../api/migrations/0040_auto_20210413_1010.py | 18 -- .../api/migrations/0041_auto_20210416_1438.py | 19 -- .../api/migrations/0042_order_payment_name.py | 17 - .../api/migrations/0043_auto_20210420_1422.py | 49 --- .../api/migrations/0044_auto_20210422_1002.py | 17 - .../api/migrations/0045_auto_20210423_1645.py | 22 -- .../api/migrations/0046_auto_20210423_1650.py | 17 - .../0047_domaincnameinfo_userdomaininfo.py | 47 --- .../api/migrations/0048_auto_20210519_1553.py | 16 - .../0049_remove_userinfo_domain_name.py | 16 - .../migrations/0050_userdomaininfo_app_id.py | 19 -- .../0051_remove_apps_domain_name.py | 16 - fir_ser/api/models.py | 8 +- fir_ser/api/views/domain.py | 11 +- fir_ser/api/views/login.py | 21 +- fir_ser/dumpdata.json | 92 ++++++ 57 files changed, 420 insertions(+), 1231 deletions(-) delete mode 100644 fir_ser/api/migrations/0002_auto_20200503_1120.py delete mode 100644 fir_ser/api/migrations/0003_apptodeveloper.py delete mode 100644 fir_ser/api/migrations/0004_auto_20200504_2054.py delete mode 100644 fir_ser/api/migrations/0005_apptodeveloper_release_file.py delete mode 100644 fir_ser/api/migrations/0006_udidsyncdeveloper.py delete mode 100644 fir_ser/api/migrations/0007_auto_20200520_1153.py delete mode 100644 fir_ser/api/migrations/0008_auto_20200922_1951.py delete mode 100644 fir_ser/api/migrations/0009_auto_20200925_2041.py delete mode 100644 fir_ser/api/migrations/0010_userinfo_api_token.py delete mode 100644 fir_ser/api/migrations/0011_auto_20210125_1137.py delete mode 100644 fir_ser/api/migrations/0012_auto_20210127_2101.py delete mode 100644 fir_ser/api/migrations/0013_auto_20210128_1815.py delete mode 100644 fir_ser/api/migrations/0014_auto_20210129_1600.py delete mode 100644 fir_ser/api/migrations/0015_auto_20210129_1730.py delete mode 100644 fir_ser/api/migrations/0016_developerappid_developerdevicesid.py delete mode 100644 fir_ser/api/migrations/0017_auto_20210131_2108.py delete mode 100644 fir_ser/api/migrations/0018_auto_20210308_1352.py delete mode 100644 fir_ser/api/migrations/0019_auto_20210308_1355.py delete mode 100644 fir_ser/api/migrations/0020_auto_20210308_1453.py delete mode 100644 fir_ser/api/migrations/0021_auto_20210308_1951.py delete mode 100644 fir_ser/api/migrations/0022_appreleaseinfo_distribution_name.py delete mode 100644 fir_ser/api/migrations/0023_auto_20210316_1602.py delete mode 100644 fir_ser/api/migrations/0024_auto_20210324_1751.py delete mode 100644 fir_ser/api/migrations/0025_order_price.py delete mode 100644 fir_ser/api/migrations/0026_auto_20210329_1419.py delete mode 100644 fir_ser/api/migrations/0027_auto_20210329_1506.py delete mode 100644 fir_ser/api/migrations/0028_order_created_time.py delete mode 100644 fir_ser/api/migrations/0029_remove_order_date.py delete mode 100644 fir_ser/api/migrations/0030_auto_20210329_1755.py delete mode 100644 fir_ser/api/migrations/0031_auto_20210407_2021.py delete mode 100644 fir_ser/api/migrations/0032_certificationinfo_type.py delete mode 100644 fir_ser/api/migrations/0033_auto_20210407_2045.py delete mode 100644 fir_ser/api/migrations/0034_usercertificationinfo_msg.py delete mode 100644 fir_ser/api/migrations/0035_usercertificationinfo_reviewed_time.py delete mode 100644 fir_ser/api/migrations/0036_auto_20210409_1512.py delete mode 100644 fir_ser/api/migrations/0037_auto_20210412_1559.py delete mode 100644 fir_ser/api/migrations/0038_auto_20210412_1601.py delete mode 100644 fir_ser/api/migrations/0039_auto_20210412_1759.py delete mode 100644 fir_ser/api/migrations/0040_auto_20210413_1010.py delete mode 100644 fir_ser/api/migrations/0041_auto_20210416_1438.py delete mode 100644 fir_ser/api/migrations/0042_order_payment_name.py delete mode 100644 fir_ser/api/migrations/0043_auto_20210420_1422.py delete mode 100644 fir_ser/api/migrations/0044_auto_20210422_1002.py delete mode 100644 fir_ser/api/migrations/0045_auto_20210423_1645.py delete mode 100644 fir_ser/api/migrations/0046_auto_20210423_1650.py delete mode 100644 fir_ser/api/migrations/0047_domaincnameinfo_userdomaininfo.py delete mode 100644 fir_ser/api/migrations/0048_auto_20210519_1553.py delete mode 100644 fir_ser/api/migrations/0049_remove_userinfo_domain_name.py delete mode 100644 fir_ser/api/migrations/0050_userdomaininfo_app_id.py delete mode 100644 fir_ser/api/migrations/0051_remove_apps_domain_name.py create mode 100644 fir_ser/dumpdata.json diff --git a/.gitignore b/.gitignore index 3edec3d..4f53015 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ fir_ser/venv/ fir_client/.idea fir_admin/.idea/.gitignore fir_admin/.idea/ +fir_client/yarn.lock +fir_download/package-lock.json +fir_client/src/assets/down_left.png +fir_client/src/assets/down_right.png diff --git a/fir_client/vue.config.js b/fir_client/vue.config.js index dd656ff..b48acbc 100644 --- a/fir_client/vue.config.js +++ b/fir_client/vue.config.js @@ -41,6 +41,7 @@ const index={ // 提取出来的通用 chunk 和 vendor chunk。 chunks: ['chunk-vendors', 'chunk-common', 'index','chunk-libs','chunk-elementUI','chunk-commons','runtime','chunk-aliOss','chunk-qiniuJs','chunk-qrcodejs2'] }; +// eslint-disable-next-line no-unused-vars const mshort={ // page 的入口 entry: 'src/main.short.js', @@ -80,13 +81,26 @@ if(page){ } } } + +function get_public_path(pages) { + if(!IS_PROD){ + return '/' + }else if(pages.index ){ + return 'https://static.dvcloud.xin/' + }else { + return 'https://static.dvstorage.cn/' //正式服,需要打包下载页静态资源 + } +} + +let publicPath = get_public_path(pages); + module.exports = { pages: pages, productionSourceMap: false, //去除生产环境的productionSourceMap assetsDir: "static", //静态文件存储位置 lintOnSave: true, runtimeCompiler:true, - // publicPath: './', + publicPath: publicPath, configureWebpack: { // provide the app's title in webpack's name field, so that // it can be accessed in index.html to inject the correct title. diff --git a/fir_ser/api/migrations/0001_initial.py b/fir_ser/api/migrations/0001_initial.py index 7984b6d..da2a66a 100644 --- a/fir_ser/api/migrations/0001_initial.py +++ b/fir_ser/api/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.0.3 on 2020-05-01 16:40 +# Generated by Django 3.0.3 on 2021-05-22 11:32 from django.conf import settings import django.contrib.auth.models @@ -35,6 +35,8 @@ class Migration(migrations.Migration): ('mobile', models.BigIntegerField(help_text='用于手机验证码登录', null=True, unique=True, verbose_name='手机')), ('qq', models.BigIntegerField(blank=True, db_index=True, null=True, verbose_name='QQ')), ('is_active', models.BooleanField(default=True, verbose_name='账户状态,默认启用')), + ('storage_active', models.BooleanField(default=False, verbose_name='配置存储,默认关闭')), + ('supersign_active', models.BooleanField(default=False, 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', @@ -44,15 +46,11 @@ class Migration(migrations.Migration): verbose_name='角色')), ('memo', models.TextField(blank=True, default=None, null=True, verbose_name='备注')), ('date_joined', models.DateTimeField(auto_now_add=True, verbose_name='注册时间')), - ('download_times', models.IntegerField(default=100, verbose_name='下载次数')), + ('download_times', models.PositiveIntegerField(default=0, verbose_name='可用下载次数,需要用户充值')), ('all_download_times', models.BigIntegerField(default=0, verbose_name='总共下载次数')), - ('domain_name', models.CharField(blank=True, max_length=64, null=True, verbose_name='域名')), ('history_release_limit', models.IntegerField(blank=True, default=10, null=True, verbose_name='app 历史记录版本')), - ('groups', models.ManyToManyField(blank=True, - help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', - related_name='user_set', related_query_name='user', to='auth.Group', - verbose_name='groups')), + ('api_token', models.CharField(default='', max_length=256, verbose_name='api访问密钥')), ], options={ 'verbose_name': '账户信息', @@ -66,9 +64,7 @@ class Migration(migrations.Migration): name='AppIOSDeveloperInfo', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=64, unique=True, verbose_name='开发者标识')), - ('email', - models.EmailField(blank=True, max_length=64, null=True, unique=True, verbose_name='email address')), + ('email', models.EmailField(blank=True, max_length=64, null=True, verbose_name='email address')), ('password', models.CharField(max_length=64)), ('is_actived', models.BooleanField(default=False, verbose_name='是否已经激活')), ('certid', models.CharField(blank=True, max_length=64, null=True, verbose_name='超级签名自动创建证书ID')), @@ -77,6 +73,11 @@ class Migration(migrations.Migration): ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), ('description', models.TextField(blank=True, default='', null=True, verbose_name='备注')), + ('issuer_id', models.CharField(blank=True, max_length=64, null=True, verbose_name='标识创建认证令牌的发放者')), + ('private_key_id', models.CharField(blank=True, max_length=64, null=True, verbose_name='密钥 ID')), + ('p8key', models.TextField(blank=True, max_length=512, null=True, verbose_name='p8key')), + ('auth_type', + models.SmallIntegerField(choices=[(0, 'p8key认证'), (1, '用户名密码认证')], default=0, verbose_name='认证类型')), ('user_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户ID')), ], @@ -91,14 +92,24 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('app_id', models.CharField(db_index=True, max_length=64, unique=True)), ('type', models.SmallIntegerField(choices=[(0, 'android'), (1, 'ios')], default=0, verbose_name='类型')), + ('status', + models.SmallIntegerField(choices=[(0, '封禁'), (1, '正常'), (2, '违规')], default=1, verbose_name='应用状态')), ('name', models.CharField(blank=True, max_length=32, null=True, verbose_name='应用名称')), ('short', models.CharField(db_index=True, max_length=16, unique=True, verbose_name='短链接')), ('bundle_id', models.CharField(blank=True, max_length=64, verbose_name='bundle id')), ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), ('count_hits', models.BigIntegerField(default=0, verbose_name='下载次数')), - ('password', models.CharField(default='', help_text='默认 没有密码', max_length=32, verbose_name='访问密码')), - ('isshow', models.BigIntegerField(default=1, verbose_name='下载页可见')), - ('issupersign', models.BigIntegerField(default=False, verbose_name='是否超级签名包')), + ('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='是否超级签名包')), + ('supersign_type', + models.SmallIntegerField(choices=[(0, '普通权限'), (1, '特殊权限(包含network、vpn)')], default=0, + verbose_name='签名类型')), + ('new_bundle_id', models.CharField(blank=True, help_text='用于超级签某些因素下需要修改包名', max_length=64, null=True, + verbose_name='new_bundle_id')), + ('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, @@ -111,6 +122,22 @@ class Migration(migrations.Migration): 'verbose_name_plural': '应用信息', }, ), + migrations.CreateModel( + name='DomainCnameInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('domain_record', models.CharField(max_length=128, unique=True, verbose_name='记录值')), + ('ip_address', models.CharField(max_length=128, verbose_name='域名解析地址')), + ('is_enable', models.BooleanField(default=True, verbose_name='是否启用该解析')), + ('is_system', models.BooleanField(default=False, verbose_name='是否是系统自带解析')), + ('description', models.TextField(blank=True, default='', null=True, verbose_name='备注')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), + ], + options={ + 'verbose_name': '分发域名信息', + 'verbose_name_plural': '分发域名信息', + }, + ), migrations.CreateModel( name='VerifyName', fields=[ @@ -128,6 +155,68 @@ class Migration(migrations.Migration): 'verbose_name_plural': '实名认证', }, ), + migrations.CreateModel( + name='UserDomainInfo', + 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_enable', models.BooleanField(default=False, 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.CASCADE, to='api.Apps', + verbose_name='APP专属域名')), + ('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')), + ], + options={ + 'verbose_name': '分发域名绑定', + 'verbose_name_plural': '分发域名绑定', + }, + ), + migrations.CreateModel( + name='UserCertificationInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=128, verbose_name='真实姓名')), + ('card', models.CharField(max_length=128, unique=True, verbose_name='身份证号码')), + ('addr', models.CharField(max_length=128, verbose_name='居住地址')), + ('mobile', models.BigIntegerField(blank=True, null=True, verbose_name='手机号码')), + ('status', + models.SmallIntegerField(choices=[(-1, '待认证'), (0, '认证中'), (1, '认证成功'), (2, '认证失败')], default=0, + verbose_name='认证状态')), + ('msg', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')), + ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), + ('reviewed_time', models.DateTimeField(auto_now_add=True, verbose_name='审核时间')), + ('user_id', + models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='certification', + to=settings.AUTH_USER_MODEL, verbose_name='用户ID')), + ], + options={ + 'verbose_name': '用户认证信息', + 'verbose_name_plural': '用户认证信息', + }, + ), + 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='型号')), + ('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='所使用苹果开发者账户')), + ], + options={ + 'verbose_name': 'iOS开发平台同步设备信息', + 'verbose_name_plural': 'iOS开发平台同步设备信息', + }, + ), migrations.CreateModel( name='Token', fields=[ @@ -138,6 +227,100 @@ class Migration(migrations.Migration): to=settings.AUTH_USER_MODEL, verbose_name='关联用户')), ], ), + migrations.CreateModel( + name='Price', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=128, unique=True, verbose_name='下载包唯一名称')), + ('title', models.CharField(max_length=128, verbose_name='下载包名称')), + ('description', models.CharField(max_length=128, verbose_name='下载包描述')), + ('price', models.BigIntegerField(verbose_name='下载包价格,单位分')), + ('package_size', models.BigIntegerField(verbose_name='下载包次数')), + ('download_count_gift', models.IntegerField(default=0, verbose_name='赠送下载次数')), + ('is_enable', models.BooleanField(default=True, verbose_name='是否启用该价格')), + ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), + ], + options={ + 'verbose_name': '价格列表', + 'verbose_name_plural': '价格列表', + 'unique_together': {('price', 'package_size')}, + }, + ), + migrations.CreateModel( + name='Order', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('payment_type', models.SmallIntegerField(choices=[(0, '微信'), (1, '支付宝'), (2, '优惠码'), (4, '银联')])), + ('payment_number', models.CharField(blank=True, max_length=128, null=True, verbose_name='支付第3方订单号')), + ('payment_name', models.CharField(blank=True, max_length=128, null=True, verbose_name='支付商家名称')), + ('order_number', models.CharField(max_length=128, unique=True, verbose_name='订单号')), + ('actual_amount', models.BigIntegerField(verbose_name='实付金额,单位分')), + ('actual_download_times', models.BigIntegerField(default=0, verbose_name='实际购买的数量')), + ('actual_download_gift_times', models.BigIntegerField(default=0, verbose_name='实际赠送的数量')), + ('status', models.SmallIntegerField( + choices=[(0, '交易成功'), (1, '待支付'), (2, '订单已创建'), (3, '退费申请中'), (4, '已退费'), (5, '主动取消'), (6, '超时取消')], + verbose_name='状态')), + ('order_type', + models.SmallIntegerField(choices=[(0, '用户下单'), (1, '后台充值')], 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)), + ], + ), + 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=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('certification_url', models.CharField(blank=True, max_length=128, verbose_name='认证URL')), + ('type', + models.SmallIntegerField(choices=[(0, '未知'), (1, '国徽面照片'), (2, '人像面照片'), (3, '手持身份证照片')], 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')), + ], + options={ + 'verbose_name': '身份证截图', + 'verbose_name_plural': '身份证截图', + }, + ), migrations.CreateModel( name='AppUDID', fields=[ @@ -158,7 +341,25 @@ class Migration(migrations.Migration): 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='api.AppIOSDeveloperInfo', + verbose_name='所使用苹果开发者账户')), + ], + options={ + 'verbose_name': '应用开发者绑定', + 'verbose_name_plural': '应用开发者绑定', }, ), migrations.CreateModel( @@ -193,15 +394,19 @@ class Migration(migrations.Migration): ('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')), ( - '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='下载域名')), ('is_https', models.BooleanField(default=True, verbose_name='是否支持https')), - ('additionalparameters', - models.TextField(blank=True, default=None, help_text='阿里云:{"sts_role_arn":"arn信息","endpoint":""} ', - null=True, verbose_name='额外参数')), + ('sts_role_arn', + models.CharField(blank=True, max_length=128, null=True, verbose_name='阿里云sts_role_arn')), + ('endpoint', models.CharField(blank=True, max_length=128, null=True, verbose_name='阿里云endpoint')), + ('download_auth_type', models.SmallIntegerField( + choices=[(1, 'OSS模式: 需要把OSS权限开启私有模式'), (2, 'CDN模式: 请先配置好阿里云CDN,开启阿里云OSS私有Bucket回源,将使用鉴权A方式')], + default=1, verbose_name='阿里云下载授权方式')), + ('cnd_auth_key', + models.CharField(blank=True, max_length=128, null=True, verbose_name='阿里云cnd_auth_key')), ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), ('description', models.TextField(blank=True, default='', null=True, verbose_name='备注')), @@ -213,14 +418,27 @@ class Migration(migrations.Migration): 'verbose_name_plural': '存储配置', }, ), + migrations.CreateModel( + name='AppScreenShot', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('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')), + ], + 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')), + '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_type', @@ -232,6 +450,8 @@ class Migration(migrations.Migration): ('icon_url', models.CharField(blank=True, max_length=128, verbose_name='图标url')), ('changelog', models.TextField(blank=True, default=None, null=True, verbose_name='更新日志')), ('udid', models.TextField(blank=True, default='', null=True, verbose_name='ios内测版 udid')), + ('distribution_name', + 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')), @@ -241,6 +461,20 @@ class Migration(migrations.Migration): 'verbose_name_plural': '应用详情', }, ), + migrations.AddField( + model_name='userinfo', + name='default_domain_name', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.DomainCnameInfo', + verbose_name='默认下载页域名'), + ), + migrations.AddField( + model_name='userinfo', + name='groups', + field=models.ManyToManyField(blank=True, + help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', + related_name='user_set', related_query_name='user', to='auth.Group', + verbose_name='groups'), + ), migrations.AddField( model_name='userinfo', name='storage', @@ -254,6 +488,30 @@ class Migration(migrations.Migration): related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'), ), + migrations.AddIndex( + 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.AlterUniqueTogether( + name='appudid', + unique_together={('app_id', 'udid')}, + ), + migrations.AddIndex( + model_name='appscreenshot', + index=models.Index(fields=['app_id'], name='api_appscre_app_id__b65655_idx'), + ), migrations.AddIndex( model_name='apps', index=models.Index(fields=['app_id'], name='api_apps_app_id_4c0254_idx'), @@ -262,4 +520,8 @@ 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'), ('user_id', 'email')}, + ), ] diff --git a/fir_ser/api/migrations/0002_auto_20200503_1120.py b/fir_ser/api/migrations/0002_auto_20200503_1120.py deleted file mode 100644 index a19a04c..0000000 --- a/fir_ser/api/migrations/0002_auto_20200503_1120.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.0.3 on 2020-05-03 11:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='appiosdeveloperinfo', - name='email', - field=models.EmailField(blank=True, max_length=64, null=True, verbose_name='email address'), - ), - migrations.AlterUniqueTogether( - name='appiosdeveloperinfo', - unique_together={('user_id', 'email')}, - ), - migrations.RemoveField( - model_name='appiosdeveloperinfo', - name='name', - ), - ] diff --git a/fir_ser/api/migrations/0003_apptodeveloper.py b/fir_ser/api/migrations/0003_apptodeveloper.py deleted file mode 100644 index f02c8b5..0000000 --- a/fir_ser/api/migrations/0003_apptodeveloper.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.0.3 on 2020-05-03 21:16 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0002_auto_20200503_1120'), - ] - - operations = [ - 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, 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': '设备使用统计', - }, - ), - ] diff --git a/fir_ser/api/migrations/0004_auto_20200504_2054.py b/fir_ser/api/migrations/0004_auto_20200504_2054.py deleted file mode 100644 index 2f21656..0000000 --- a/fir_ser/api/migrations/0004_auto_20200504_2054.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.0.3 on 2020-05-04 20:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0003_apptodeveloper'), - ] - - operations = [ - migrations.AlterModelOptions( - name='apptodeveloper', - options={'verbose_name': '应用开发者绑定', 'verbose_name_plural': '应用开发者绑定'}, - ), - migrations.AlterField( - model_name='apptodeveloper', - name='binary_file', - field=models.CharField(blank=True, max_length=128, null=True, unique=True, verbose_name='签名包名称'), - ), - ] diff --git a/fir_ser/api/migrations/0005_apptodeveloper_release_file.py b/fir_ser/api/migrations/0005_apptodeveloper_release_file.py deleted file mode 100644 index 529a5b3..0000000 --- a/fir_ser/api/migrations/0005_apptodeveloper_release_file.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2020-05-05 14:23 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0004_auto_20200504_2054'), - ] - - operations = [ - migrations.AddField( - model_name='apptodeveloper', - name='release_file', - field=models.CharField(blank=True, max_length=128, null=True, verbose_name='源包名称'), - ), - ] diff --git a/fir_ser/api/migrations/0006_udidsyncdeveloper.py b/fir_ser/api/migrations/0006_udidsyncdeveloper.py deleted file mode 100644 index 63fbc6f..0000000 --- a/fir_ser/api/migrations/0006_udidsyncdeveloper.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 3.0.3 on 2020-05-05 17:41 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0005_apptodeveloper_release_file'), - ] - - operations = [ - 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='型号')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), - ('developerid', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.AppIOSDeveloperInfo', - verbose_name='所使用苹果开发者账户')), - ], - options={ - 'verbose_name': 'iOS开发平台同步设备信息', - 'verbose_name_plural': 'iOS开发平台同步设备信息', - 'unique_together': {('udid', 'developerid')}, - }, - ), - ] diff --git a/fir_ser/api/migrations/0007_auto_20200520_1153.py b/fir_ser/api/migrations/0007_auto_20200520_1153.py deleted file mode 100644 index 7d49437..0000000 --- a/fir_ser/api/migrations/0007_auto_20200520_1153.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.0.3 on 2020-05-20 11:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0006_udidsyncdeveloper'), - ] - - operations = [ - migrations.AddField( - model_name='apps', - name='wxeasytype', - field=models.BigIntegerField(default=True, verbose_name='微信内简易房屋,避免微信封停'), - ), - migrations.AddField( - model_name='apps', - name='wxredirect', - field=models.BigIntegerField(default=True, verbose_name='微信内第三方链接自动跳转'), - ), - ] diff --git a/fir_ser/api/migrations/0008_auto_20200922_1951.py b/fir_ser/api/migrations/0008_auto_20200922_1951.py deleted file mode 100644 index 7cd0a7b..0000000 --- a/fir_ser/api/migrations/0008_auto_20200922_1951.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2020-09-22 19:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0007_auto_20200520_1153'), - ] - - operations = [ - migrations.AlterField( - model_name='userinfo', - name='domain_name', - field=models.CharField(blank=True, max_length=64, null=True, verbose_name='下载页面域名'), - ), - ] diff --git a/fir_ser/api/migrations/0009_auto_20200925_2041.py b/fir_ser/api/migrations/0009_auto_20200925_2041.py deleted file mode 100644 index 1a3b786..0000000 --- a/fir_ser/api/migrations/0009_auto_20200925_2041.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 3.0.3 on 2020-09-25 20:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0008_auto_20200922_1951'), - ] - - operations = [ - migrations.AddField( - model_name='userinfo', - name='storage_active', - field=models.BooleanField(default=False, verbose_name='配置存储,默认关闭'), - ), - migrations.AddField( - model_name='userinfo', - name='supersign_active', - field=models.BooleanField(default=False, verbose_name='配置超级签,默认关闭'), - ), - migrations.AlterField( - model_name='userinfo', - name='download_times', - field=models.IntegerField(default=100, verbose_name='可用下载次数'), - ), - ] diff --git a/fir_ser/api/migrations/0010_userinfo_api_token.py b/fir_ser/api/migrations/0010_userinfo_api_token.py deleted file mode 100644 index a7ee93c..0000000 --- a/fir_ser/api/migrations/0010_userinfo_api_token.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-01-07 18:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0009_auto_20200925_2041'), - ] - - operations = [ - migrations.AddField( - model_name='userinfo', - name='api_token', - field=models.CharField(default='', max_length=256, verbose_name='api访问密钥'), - ), - ] diff --git a/fir_ser/api/migrations/0011_auto_20210125_1137.py b/fir_ser/api/migrations/0011_auto_20210125_1137.py deleted file mode 100644 index 28a94ea..0000000 --- a/fir_ser/api/migrations/0011_auto_20210125_1137.py +++ /dev/null @@ -1,22 +0,0 @@ -# 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/migrations/0012_auto_20210127_2101.py b/fir_ser/api/migrations/0012_auto_20210127_2101.py deleted file mode 100644 index 558f1b7..0000000 --- a/fir_ser/api/migrations/0012_auto_20210127_2101.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.3 on 2021-01-27 21:01 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0011_auto_20210125_1137'), - ] - - operations = [ - migrations.AlterField( - model_name='udidsyncdeveloper', - name='platform', - field=models.SmallIntegerField(choices=[(0, 'fly分发'), (1, 'app developer')], default=0, - verbose_name='udid所在平台'), - ), - ] diff --git a/fir_ser/api/migrations/0013_auto_20210128_1815.py b/fir_ser/api/migrations/0013_auto_20210128_1815.py deleted file mode 100644 index 865bbe8..0000000 --- a/fir_ser/api/migrations/0013_auto_20210128_1815.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.0.3 on 2021-01-28 18:15 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0012_auto_20210127_2101'), - ] - - operations = [ - migrations.AddField( - model_name='apps', - name='domain_name', - field=models.CharField(blank=True, max_length=64, null=True, verbose_name='专属访问域名'), - ), - migrations.AlterField( - model_name='apps', - name='wxeasytype', - field=models.BigIntegerField(default=True, verbose_name='微信内简易模式,避免微信封停'), - ), - ] diff --git a/fir_ser/api/migrations/0014_auto_20210129_1600.py b/fir_ser/api/migrations/0014_auto_20210129_1600.py deleted file mode 100644 index e7f2d55..0000000 --- a/fir_ser/api/migrations/0014_auto_20210129_1600.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 3.0.3 on 2021-01-29 16:00 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0013_auto_20210128_1815'), - ] - - operations = [ - migrations.AddField( - model_name='appiosdeveloperinfo', - name='auth_type', - field=models.SmallIntegerField(choices=[(0, 'p8key认证'), (1, '用户名密码认证')], default=0, verbose_name='认证类型'), - ), - migrations.AddField( - model_name='appiosdeveloperinfo', - name='issuer_id', - field=models.CharField(blank=True, max_length=64, null=True, verbose_name='标识创建认证令牌的发放者'), - ), - migrations.AddField( - model_name='appiosdeveloperinfo', - name='p8key', - field=models.CharField(blank=True, max_length=512, null=True, verbose_name='p8key'), - ), - migrations.AddField( - model_name='appiosdeveloperinfo', - name='private_key_id', - field=models.CharField(blank=True, max_length=64, null=True, verbose_name='密钥 ID'), - ), - migrations.AlterUniqueTogether( - name='appiosdeveloperinfo', - unique_together={('user_id', 'issuer_id'), ('user_id', 'email')}, - ), - ] diff --git a/fir_ser/api/migrations/0015_auto_20210129_1730.py b/fir_ser/api/migrations/0015_auto_20210129_1730.py deleted file mode 100644 index 718285a..0000000 --- a/fir_ser/api/migrations/0015_auto_20210129_1730.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-01-29 17:30 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0014_auto_20210129_1600'), - ] - - operations = [ - migrations.AlterField( - model_name='appiosdeveloperinfo', - name='p8key', - field=models.TextField(blank=True, max_length=512, null=True, verbose_name='p8key'), - ), - ] diff --git a/fir_ser/api/migrations/0016_developerappid_developerdevicesid.py b/fir_ser/api/migrations/0016_developerappid_developerdevicesid.py deleted file mode 100644 index 791fabb..0000000 --- a/fir_ser/api/migrations/0016_developerappid_developerdevicesid.py +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by Django 3.0.3 on 2021-01-31 19:55 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0015_auto_20210129_1730'), - ] - - operations = [ - 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.AppUDID', - 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)), - ('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', - 'unique_together': {('aid', 'developerid', 'app_id')}, - }, - ), - ] diff --git a/fir_ser/api/migrations/0017_auto_20210131_2108.py b/fir_ser/api/migrations/0017_auto_20210131_2108.py deleted file mode 100644 index d494b33..0000000 --- a/fir_ser/api/migrations/0017_auto_20210131_2108.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.0.3 on 2021-01-31 21:08 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0016_developerappid_developerdevicesid'), - ] - - operations = [ - migrations.AlterField( - model_name='developerdevicesid', - 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/0018_auto_20210308_1352.py b/fir_ser/api/migrations/0018_auto_20210308_1352.py deleted file mode 100644 index b10fec3..0000000 --- a/fir_ser/api/migrations/0018_auto_20210308_1352.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-08 13:52 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0017_auto_20210131_2108'), - ] - - operations = [ - migrations.AddField( - model_name='apps', - name='enable_push_vpn', - field=models.BigIntegerField(default=False, verbose_name='特殊权限(包含network、vpn)'), - ), - migrations.AddField( - model_name='apps', - name='new_bundle_id', - field=models.CharField(blank=True, help_text='用与超级签某些因素下修改包名', max_length=64, verbose_name='new_bundle_id'), - ), - ] diff --git a/fir_ser/api/migrations/0019_auto_20210308_1355.py b/fir_ser/api/migrations/0019_auto_20210308_1355.py deleted file mode 100644 index e43c3fc..0000000 --- a/fir_ser/api/migrations/0019_auto_20210308_1355.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-08 13:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0018_auto_20210308_1352'), - ] - - operations = [ - migrations.RemoveField( - model_name='apps', - name='enable_push_vpn', - ), - migrations.AddField( - model_name='apps', - name='supersign_type', - field=models.SmallIntegerField(choices=[(0, '普通权限'), (1, '特殊权限(包含network、vpn)')], default=0, - verbose_name='签名类型'), - ), - ] diff --git a/fir_ser/api/migrations/0020_auto_20210308_1453.py b/fir_ser/api/migrations/0020_auto_20210308_1453.py deleted file mode 100644 index c972648..0000000 --- a/fir_ser/api/migrations/0020_auto_20210308_1453.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-08 14:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0019_auto_20210308_1355'), - ] - - operations = [ - migrations.AlterField( - model_name='apps', - name='new_bundle_id', - field=models.CharField(blank=True, help_text='用与超级签某些因素下修改包名', max_length=64, null=True, - verbose_name='new_bundle_id'), - ), - ] diff --git a/fir_ser/api/migrations/0021_auto_20210308_1951.py b/fir_ser/api/migrations/0021_auto_20210308_1951.py deleted file mode 100644 index c554999..0000000 --- a/fir_ser/api/migrations/0021_auto_20210308_1951.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-08 19:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0020_auto_20210308_1453'), - ] - - operations = [ - migrations.AddField( - model_name='apps', - name='supersign_limit_number', - field=models.IntegerField(default=0, verbose_name='签名使用限额'), - ), - migrations.AlterField( - model_name='apps', - name='new_bundle_id', - field=models.CharField(blank=True, help_text='用于超级签某些因素下需要修改包名', max_length=64, null=True, - verbose_name='new_bundle_id'), - ), - ] diff --git a/fir_ser/api/migrations/0022_appreleaseinfo_distribution_name.py b/fir_ser/api/migrations/0022_appreleaseinfo_distribution_name.py deleted file mode 100644 index 2a6d1aa..0000000 --- a/fir_ser/api/migrations/0022_appreleaseinfo_distribution_name.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-16 14:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0021_auto_20210308_1951'), - ] - - operations = [ - migrations.AddField( - model_name='appreleaseinfo', - name='distribution_name', - field=models.CharField(blank=True, default='', max_length=128, null=True, verbose_name='企业签名'), - ), - ] diff --git a/fir_ser/api/migrations/0023_auto_20210316_1602.py b/fir_ser/api/migrations/0023_auto_20210316_1602.py deleted file mode 100644 index 29e3222..0000000 --- a/fir_ser/api/migrations/0023_auto_20210316_1602.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-16 16:02 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0022_appreleaseinfo_distribution_name'), - ] - - operations = [ - migrations.CreateModel( - name='AppScreenShot', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('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')), - ], - options={ - 'verbose_name': '应用截图', - 'verbose_name_plural': '应用截图', - }, - ), - migrations.AddIndex( - model_name='appscreenshot', - index=models.Index(fields=['app_id'], name='api_appscre_app_id__b65655_idx'), - ), - ] diff --git a/fir_ser/api/migrations/0024_auto_20210324_1751.py b/fir_ser/api/migrations/0024_auto_20210324_1751.py deleted file mode 100644 index f212467..0000000 --- a/fir_ser/api/migrations/0024_auto_20210324_1751.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-24 17:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0023_auto_20210316_1602'), - ] - - operations = [ - migrations.AlterField( - model_name='userinfo', - name='download_times', - field=models.PositiveIntegerField(default=0, verbose_name='可用下载次数,需要用户充值'), - ), - ] diff --git a/fir_ser/api/migrations/0025_order_price.py b/fir_ser/api/migrations/0025_order_price.py deleted file mode 100644 index 8464bc9..0000000 --- a/fir_ser/api/migrations/0025_order_price.py +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-29 14:10 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0024_auto_20210324_1751'), - ] - - operations = [ - migrations.CreateModel( - name='Price', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=128, unique=True, verbose_name='下载包唯一名称')), - ('title', models.CharField(max_length=128, verbose_name='下载包名称')), - ('description', models.CharField(max_length=128, verbose_name='下载包描述')), - ('price', models.FloatField(verbose_name='下载包价格')), - ('package_size', models.BigIntegerField(verbose_name='下载包次数')), - ('download_count_gift', models.IntegerField(default=0, verbose_name='赠送下载次数')), - ('is_enable', models.BooleanField(default=True, verbose_name='是否启用该价格')), - ('updated_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')), - ], - options={ - 'verbose_name': '价格列表', - 'verbose_name_plural': '价格列表', - 'unique_together': {('price', 'package_size')}, - }, - ), - migrations.CreateModel( - name='Order', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('payment_type', models.SmallIntegerField(choices=[(0, '微信'), (1, '支付宝'), (2, '优惠码'), (4, '银联')])), - ('payment_number', models.CharField(blank=True, max_length=128, null=True, verbose_name='支付第3方订单号')), - ('order_number', models.CharField(max_length=128, unique=True, verbose_name='订单号')), - ('actual_amount', models.FloatField(verbose_name='实付金额')), - ('status', models.SmallIntegerField( - choices=[(0, '交易成功'), (1, '待支付'), (2, '退费申请中'), (3, '已退费'), (4, '主动取消'), (5, '超时取消')], - verbose_name='状态')), - ('order_type', - models.SmallIntegerField(choices=[(0, '用户下单'), (1, '后台充值')], default=0, verbose_name='订单类型')), - ('date', models.DateTimeField(auto_now_add=True, verbose_name='订单生成时间')), - ('pay_time', models.DateTimeField(blank=True, null=True, verbose_name='付款时间')), - ('cancel_time', models.DateTimeField(blank=True, null=True, verbose_name='订单取消时间')), - ( - 'account', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/fir_ser/api/migrations/0026_auto_20210329_1419.py b/fir_ser/api/migrations/0026_auto_20210329_1419.py deleted file mode 100644 index 8dce364..0000000 --- a/fir_ser/api/migrations/0026_auto_20210329_1419.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-29 14:19 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0025_order_price'), - ] - - operations = [ - migrations.AlterField( - model_name='price', - name='price', - field=models.BigIntegerField(verbose_name='下载包价格'), - ), - ] diff --git a/fir_ser/api/migrations/0027_auto_20210329_1506.py b/fir_ser/api/migrations/0027_auto_20210329_1506.py deleted file mode 100644 index dcde6f7..0000000 --- a/fir_ser/api/migrations/0027_auto_20210329_1506.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-29 15:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0026_auto_20210329_1419'), - ] - - operations = [ - migrations.AddField( - model_name='order', - name='actual_download_gift_times', - field=models.BigIntegerField(default=0, verbose_name='实际赠送的数量'), - preserve_default=False, - ), - migrations.AddField( - model_name='order', - name='actual_download_times', - field=models.BigIntegerField(default=0, verbose_name='实际购买的数量'), - preserve_default=False, - ), - migrations.AlterField( - model_name='order', - name='actual_amount', - field=models.BigIntegerField(verbose_name='实付金额,单位分'), - ), - migrations.AlterField( - model_name='price', - name='price', - field=models.BigIntegerField(verbose_name='下载包价格,单位分'), - ), - ] diff --git a/fir_ser/api/migrations/0028_order_created_time.py b/fir_ser/api/migrations/0028_order_created_time.py deleted file mode 100644 index 1d5bf81..0000000 --- a/fir_ser/api/migrations/0028_order_created_time.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-29 15:12 - -from django.db import migrations, models -import django.utils.timezone - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0027_auto_20210329_1506'), - ] - - operations = [ - migrations.AddField( - model_name='order', - name='created_time', - field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now, verbose_name='订单创建时间'), - preserve_default=False, - ), - ] diff --git a/fir_ser/api/migrations/0029_remove_order_date.py b/fir_ser/api/migrations/0029_remove_order_date.py deleted file mode 100644 index 6e95ab8..0000000 --- a/fir_ser/api/migrations/0029_remove_order_date.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-29 16:27 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0028_order_created_time'), - ] - - operations = [ - migrations.RemoveField( - model_name='order', - name='date', - ), - ] diff --git a/fir_ser/api/migrations/0030_auto_20210329_1755.py b/fir_ser/api/migrations/0030_auto_20210329_1755.py deleted file mode 100644 index 3afdac2..0000000 --- a/fir_ser/api/migrations/0030_auto_20210329_1755.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 3.0.3 on 2021-03-29 17:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0029_remove_order_date'), - ] - - operations = [ - migrations.AddField( - model_name='order', - name='description', - field=models.TextField(blank=True, default='', null=True, verbose_name='备注'), - ), - migrations.AlterField( - model_name='order', - name='actual_download_gift_times', - field=models.BigIntegerField(default=0, verbose_name='实际赠送的数量'), - ), - migrations.AlterField( - model_name='order', - name='actual_download_times', - field=models.BigIntegerField(default=0, verbose_name='实际购买的数量'), - ), - ] diff --git a/fir_ser/api/migrations/0031_auto_20210407_2021.py b/fir_ser/api/migrations/0031_auto_20210407_2021.py deleted file mode 100644 index 309b690..0000000 --- a/fir_ser/api/migrations/0031_auto_20210407_2021.py +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-07 20:21 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0030_auto_20210329_1755'), - ] - - operations = [ - migrations.CreateModel( - name='UserCertificationInfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=128, verbose_name='真实姓名')), - ('card', models.CharField(max_length=128, verbose_name='身份证号码')), - ('addr', models.CharField(max_length=128, verbose_name='居住地')), - ('mobile', models.BigIntegerField(unique=True, verbose_name='手机号码')), - ('status', models.SmallIntegerField(choices=[(0, '审核中'), (1, '审核成功'), (2, '审核失败')], 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')), - ], - options={ - 'verbose_name': '用户认证信息', - 'verbose_name_plural': '用户认证信息', - }, - ), - migrations.CreateModel( - name='CertificationInfo', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('certification_url', models.CharField(blank=True, max_length=128, verbose_name='认证URL')), - ('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': '身份证截图', - }, - ), - migrations.AddIndex( - model_name='usercertificationinfo', - index=models.Index(fields=['card'], name='api_usercer_card_246743_idx'), - ), - ] diff --git a/fir_ser/api/migrations/0032_certificationinfo_type.py b/fir_ser/api/migrations/0032_certificationinfo_type.py deleted file mode 100644 index 97ba559..0000000 --- a/fir_ser/api/migrations/0032_certificationinfo_type.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-07 20:44 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0031_auto_20210407_2021'), - ] - - operations = [ - migrations.AddField( - model_name='certificationinfo', - name='type', - field=models.SmallIntegerField(choices=[(0, '国徽面照片'), (1, '人像面照片'), (2, '手持身份证照片')], default=0, - verbose_name='图像类型'), - preserve_default=False, - ), - ] diff --git a/fir_ser/api/migrations/0033_auto_20210407_2045.py b/fir_ser/api/migrations/0033_auto_20210407_2045.py deleted file mode 100644 index aa43c29..0000000 --- a/fir_ser/api/migrations/0033_auto_20210407_2045.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-07 20:45 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0032_certificationinfo_type'), - ] - - operations = [ - migrations.AlterField( - model_name='certificationinfo', - name='type', - field=models.SmallIntegerField(choices=[(0, '未知'), (1, '国徽面照片'), (2, '人像面照片'), (3, '手持身份证照片')], default=0, - verbose_name='图像类型'), - ), - ] diff --git a/fir_ser/api/migrations/0034_usercertificationinfo_msg.py b/fir_ser/api/migrations/0034_usercertificationinfo_msg.py deleted file mode 100644 index 7a8e2c4..0000000 --- a/fir_ser/api/migrations/0034_usercertificationinfo_msg.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-08 18:11 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0033_auto_20210407_2045'), - ] - - operations = [ - migrations.AddField( - model_name='usercertificationinfo', - name='msg', - field=models.CharField(blank=True, max_length=512, null=True, verbose_name='备注'), - ), - ] diff --git a/fir_ser/api/migrations/0035_usercertificationinfo_reviewed_time.py b/fir_ser/api/migrations/0035_usercertificationinfo_reviewed_time.py deleted file mode 100644 index 1bcdd29..0000000 --- a/fir_ser/api/migrations/0035_usercertificationinfo_reviewed_time.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-08 18:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0034_usercertificationinfo_msg'), - ] - - operations = [ - migrations.AddField( - model_name='usercertificationinfo', - name='reviewed_time', - field=models.DateTimeField(default='2021-04-08 16:28:28.142887', verbose_name='审核时间'), - preserve_default=False, - ), - ] diff --git a/fir_ser/api/migrations/0036_auto_20210409_1512.py b/fir_ser/api/migrations/0036_auto_20210409_1512.py deleted file mode 100644 index 8cc8751..0000000 --- a/fir_ser/api/migrations/0036_auto_20210409_1512.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-09 15:12 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0035_usercertificationinfo_reviewed_time'), - ] - - operations = [ - migrations.AlterField( - model_name='usercertificationinfo', - name='user_id', - field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='certification', - to=settings.AUTH_USER_MODEL, verbose_name='用户ID'), - ), - ] diff --git a/fir_ser/api/migrations/0037_auto_20210412_1559.py b/fir_ser/api/migrations/0037_auto_20210412_1559.py deleted file mode 100644 index 7adef52..0000000 --- a/fir_ser/api/migrations/0037_auto_20210412_1559.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-12 15:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0036_auto_20210409_1512'), - ] - - operations = [ - migrations.AddField( - model_name='apps', - name='status', - field=models.SmallIntegerField(choices=[(0, '正常'), (1, '封禁'), (2, '违规')], default=0, verbose_name='应用状态'), - ), - migrations.AlterField( - model_name='apps', - name='isshow', - field=models.BooleanField(default=True, verbose_name='下载页可见'), - ), - migrations.AlterField( - model_name='apps', - name='issupersign', - field=models.BooleanField(default=False, verbose_name='是否超级签名包'), - ), - migrations.AlterField( - model_name='apps', - name='wxeasytype', - field=models.BooleanField(default=True, verbose_name='微信内简易模式,避免微信封停'), - ), - migrations.AlterField( - model_name='apps', - name='wxredirect', - field=models.BooleanField(default=True, verbose_name='微信内第三方链接自动跳转'), - ), - ] diff --git a/fir_ser/api/migrations/0038_auto_20210412_1601.py b/fir_ser/api/migrations/0038_auto_20210412_1601.py deleted file mode 100644 index 2f0ec34..0000000 --- a/fir_ser/api/migrations/0038_auto_20210412_1601.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-12 16:01 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0037_auto_20210412_1559'), - ] - - operations = [ - migrations.AlterField( - model_name='apps', - name='status', - field=models.SmallIntegerField(choices=[(0, '封禁'), (1, '正常'), (2, '违规')], default=1, verbose_name='应用状态'), - ), - ] diff --git a/fir_ser/api/migrations/0039_auto_20210412_1759.py b/fir_ser/api/migrations/0039_auto_20210412_1759.py deleted file mode 100644 index b9289bf..0000000 --- a/fir_ser/api/migrations/0039_auto_20210412_1759.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-12 17:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0038_auto_20210412_1601'), - ] - - operations = [ - migrations.AlterField( - model_name='apps', - name='password', - field=models.CharField(blank=True, help_text='默认 没有密码', max_length=32, verbose_name='访问密码'), - ), - ] diff --git a/fir_ser/api/migrations/0040_auto_20210413_1010.py b/fir_ser/api/migrations/0040_auto_20210413_1010.py deleted file mode 100644 index 58fb4f1..0000000 --- a/fir_ser/api/migrations/0040_auto_20210413_1010.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-13 10:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0039_auto_20210412_1759'), - ] - - operations = [ - migrations.AlterField( - model_name='usercertificationinfo', - name='status', - field=models.SmallIntegerField(choices=[(-1, '待认证'), (0, '认证中'), (1, '认证成功'), (2, '认证失败')], default=0, - verbose_name='审核状态'), - ), - ] diff --git a/fir_ser/api/migrations/0041_auto_20210416_1438.py b/fir_ser/api/migrations/0041_auto_20210416_1438.py deleted file mode 100644 index 12b1659..0000000 --- a/fir_ser/api/migrations/0041_auto_20210416_1438.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-16 14:38 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0040_auto_20210413_1010'), - ] - - operations = [ - migrations.AlterField( - model_name='order', - name='status', - field=models.SmallIntegerField( - choices=[(0, '交易成功'), (1, '待支付'), (2, '订单已创建'), (3, '退费申请中'), (4, '已退费'), (5, '主动取消'), (6, '超时取消')], - verbose_name='状态'), - ), - ] diff --git a/fir_ser/api/migrations/0042_order_payment_name.py b/fir_ser/api/migrations/0042_order_payment_name.py deleted file mode 100644 index 02222fc..0000000 --- a/fir_ser/api/migrations/0042_order_payment_name.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-18 17:24 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0041_auto_20210416_1438'), - ] - - operations = [ - migrations.AddField( - model_name='order', - name='payment_name', - field=models.CharField(blank=True, max_length=128, null=True, verbose_name='支付商家名称'), - ), - ] diff --git a/fir_ser/api/migrations/0043_auto_20210420_1422.py b/fir_ser/api/migrations/0043_auto_20210420_1422.py deleted file mode 100644 index cdafcec..0000000 --- a/fir_ser/api/migrations/0043_auto_20210420_1422.py +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-20 14:22 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0042_order_payment_name'), - ] - - operations = [ - migrations.RemoveField( - model_name='appstorage', - name='additionalparameters', - ), - migrations.AddField( - model_name='appstorage', - name='cnd_auth_key', - field=models.CharField(blank=True, max_length=128, null=True, verbose_name='阿里云cnd_auth_key'), - ), - migrations.AddField( - model_name='appstorage', - name='download_auth_type', - field=models.SmallIntegerField( - choices=[(1, 'OSS模式: 需要把OSS权限开启私有模式'), (2, 'CDN模式: 请先配置好阿里云CDN,开启阿里云OSS私有Bucket回源,将使用鉴权A方式')], - default=1, verbose_name='阿里云下载授权方式'), - ), - migrations.AddField( - model_name='appstorage', - name='endpoint', - field=models.CharField(blank=True, max_length=128, null=True, verbose_name='阿里云endpoint'), - ), - migrations.AddField( - model_name='appstorage', - name='sts_role_arn', - field=models.CharField(blank=True, max_length=128, null=True, verbose_name='阿里云sts_role_arn'), - ), - migrations.AlterField( - model_name='usercertificationinfo', - name='addr', - field=models.CharField(max_length=128, verbose_name='居住地址'), - ), - migrations.AlterField( - model_name='usercertificationinfo', - name='status', - field=models.SmallIntegerField(choices=[(-1, '待认证'), (0, '认证中'), (1, '认证成功'), (2, '认证失败')], default=0, - verbose_name='认证状态'), - ), - ] diff --git a/fir_ser/api/migrations/0044_auto_20210422_1002.py b/fir_ser/api/migrations/0044_auto_20210422_1002.py deleted file mode 100644 index a42ead4..0000000 --- a/fir_ser/api/migrations/0044_auto_20210422_1002.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-22 10:02 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0043_auto_20210420_1422'), - ] - - operations = [ - migrations.RenameField( - model_name='order', - old_name='account', - new_name='user_id', - ), - ] diff --git a/fir_ser/api/migrations/0045_auto_20210423_1645.py b/fir_ser/api/migrations/0045_auto_20210423_1645.py deleted file mode 100644 index f9ddaa7..0000000 --- a/fir_ser/api/migrations/0045_auto_20210423_1645.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-23 16:45 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0044_auto_20210422_1002'), - ] - - operations = [ - migrations.AlterField( - model_name='usercertificationinfo', - name='card', - field=models.CharField(max_length=128, unique=True, verbose_name='身份证号码'), - ), - migrations.AlterField( - model_name='usercertificationinfo', - name='mobile', - field=models.BigIntegerField(blank=True, null=True, verbose_name='手机号码'), - ), - ] diff --git a/fir_ser/api/migrations/0046_auto_20210423_1650.py b/fir_ser/api/migrations/0046_auto_20210423_1650.py deleted file mode 100644 index 64689fe..0000000 --- a/fir_ser/api/migrations/0046_auto_20210423_1650.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.0.3 on 2021-04-23 16:50 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0045_auto_20210423_1645'), - ] - - operations = [ - migrations.AlterField( - model_name='usercertificationinfo', - name='reviewed_time', - field=models.DateTimeField(auto_now_add=True, verbose_name='审核时间'), - ), - ] diff --git a/fir_ser/api/migrations/0047_domaincnameinfo_userdomaininfo.py b/fir_ser/api/migrations/0047_domaincnameinfo_userdomaininfo.py deleted file mode 100644 index fa22fe0..0000000 --- a/fir_ser/api/migrations/0047_domaincnameinfo_userdomaininfo.py +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by Django 3.0.3 on 2021-05-19 10:35 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0046_auto_20210423_1650'), - ] - - operations = [ - migrations.CreateModel( - name='DomainCnameInfo', - fields=[ - ('domain_record', - models.CharField(max_length=128, primary_key=True, serialize=False, verbose_name='记录值')), - ('ip_address', models.GenericIPAddressField(verbose_name='域名解析地址')), - ('is_enable', models.BooleanField(default=True, verbose_name='是否启用该解析')), - ('description', models.TextField(blank=True, default='', null=True, verbose_name='备注')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), - ], - options={ - 'verbose_name': '分发域名信息', - 'verbose_name_plural': '分发域名信息', - }, - ), - migrations.CreateModel( - name='UserDomainInfo', - 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_enable', models.BooleanField(default=False, verbose_name='绑定成功')), - ('created_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), - ('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')), - ], - options={ - 'verbose_name': '分发域名绑定', - 'verbose_name_plural': '分发域名绑定', - 'unique_together': {('domain_name', 'is_enable')}, - }, - ), - ] diff --git a/fir_ser/api/migrations/0048_auto_20210519_1553.py b/fir_ser/api/migrations/0048_auto_20210519_1553.py deleted file mode 100644 index 313145c..0000000 --- a/fir_ser/api/migrations/0048_auto_20210519_1553.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.0.3 on 2021-05-19 15:53 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0047_domaincnameinfo_userdomaininfo'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='userdomaininfo', - unique_together=set(), - ), - ] diff --git a/fir_ser/api/migrations/0049_remove_userinfo_domain_name.py b/fir_ser/api/migrations/0049_remove_userinfo_domain_name.py deleted file mode 100644 index fbaaeba..0000000 --- a/fir_ser/api/migrations/0049_remove_userinfo_domain_name.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.0.3 on 2021-05-19 16:53 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0048_auto_20210519_1553'), - ] - - operations = [ - migrations.RemoveField( - model_name='userinfo', - name='domain_name', - ), - ] diff --git a/fir_ser/api/migrations/0050_userdomaininfo_app_id.py b/fir_ser/api/migrations/0050_userdomaininfo_app_id.py deleted file mode 100644 index 74fd90d..0000000 --- a/fir_ser/api/migrations/0050_userdomaininfo_app_id.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.0.3 on 2021-05-19 18:15 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0049_remove_userinfo_domain_name'), - ] - - operations = [ - migrations.AddField( - model_name='userdomaininfo', - name='app_id', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Apps', - verbose_name='APP专属域名'), - ), - ] diff --git a/fir_ser/api/migrations/0051_remove_apps_domain_name.py b/fir_ser/api/migrations/0051_remove_apps_domain_name.py deleted file mode 100644 index afe5b21..0000000 --- a/fir_ser/api/migrations/0051_remove_apps_domain_name.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.0.3 on 2021-05-19 21:41 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('api', '0050_userdomaininfo_app_id'), - ] - - operations = [ - migrations.RemoveField( - model_name='apps', - name='domain_name', - ), - ] diff --git a/fir_ser/api/models.py b/fir_ser/api/models.py index e66ffdb..01a7d67 100644 --- a/fir_ser/api/models.py +++ b/fir_ser/api/models.py @@ -41,7 +41,7 @@ class UserInfo(AbstractUser): date_joined = models.DateTimeField(auto_now_add=True, verbose_name="注册时间") download_times = models.PositiveIntegerField(default=0, verbose_name="可用下载次数,需要用户充值") all_download_times = models.BigIntegerField(default=0, verbose_name="总共下载次数") - # domain_name = models.CharField(verbose_name="下载页面域名", blank=True, null=True, max_length=64) + default_domain_name = models.ForeignKey(to="DomainCnameInfo", verbose_name="默认下载页域名", on_delete=models.CASCADE) history_release_limit = models.IntegerField(default=10, verbose_name="app 历史记录版本", blank=True, null=True) storage = models.OneToOneField(to='AppStorage', related_name='app_storage', on_delete=models.SET_NULL, verbose_name="存储", null=True, blank=True) @@ -448,10 +448,10 @@ class CertificationInfo(models.Model): class DomainCnameInfo(models.Model): - domain_record = models.CharField(max_length=128, primary_key=True, verbose_name="记录值") - ip_address = models.GenericIPAddressField(verbose_name="域名解析地址", null=False) - # reference_count = models.BigIntegerField(default=0, verbose_name="引用记录值") + domain_record = models.CharField(max_length=128, unique=True, verbose_name="记录值") + ip_address = models.CharField(max_length=128, verbose_name="域名解析地址", null=False) is_enable = models.BooleanField(default=True, verbose_name="是否启用该解析") + is_system = models.BooleanField(default=False, verbose_name="是否是系统自带解析") description = models.TextField(verbose_name='备注', blank=True, null=True, default='') created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") diff --git a/fir_ser/api/views/domain.py b/fir_ser/api/views/domain.py index 2299f72..5e84a89 100644 --- a/fir_ser/api/views/domain.py +++ b/fir_ser/api/views/domain.py @@ -57,14 +57,15 @@ class DomainCnameView(APIView): res.data = {'cname_domain': user_domian_obj.cname_id.domain_record} else: UserDomainInfo.objects.filter(**get_domain_filter(request), is_enable=False).delete() - min_domian_cname_info_obj = min( - DomainCnameInfo.objects.annotate(Count('userdomaininfo')).filter(is_enable=True), + min_domain_cname_info_obj = min( + DomainCnameInfo.objects.annotate(Count('userdomaininfo')).filter(is_enable=True, + is_system=False), key=lambda x: x.userdomaininfo__count) - if min_domian_cname_info_obj: - res.data = {'cname_domain': min_domian_cname_info_obj.domain_record} + if min_domain_cname_info_obj: + res.data = {'cname_domain': min_domain_cname_info_obj.domain_record} data_dict = { 'user_id': request.user, - 'cname_id': min_domian_cname_info_obj, + 'cname_id': min_domain_cname_info_obj, 'domain_name': domain_name, 'app_id': None, } diff --git a/fir_ser/api/views/login.py b/fir_ser/api/views/login.py index 6c362ca..b07cc78 100644 --- a/fir_ser/api/views/login.py +++ b/fir_ser/api/views/login.py @@ -1,5 +1,7 @@ from django.contrib import auth -from api.models import Token, UserInfo, UserCertificationInfo, CertificationInfo +from django.db.models import Count + +from api.models import Token, UserInfo, UserCertificationInfo, CertificationInfo, DomainCnameInfo from rest_framework.response import Response from api.utils.serializer import UserInfoSerializer, CertificationSerializer, UserCertificationSerializer from django.core.cache import cache @@ -336,13 +338,22 @@ class RegistView(APIView): password2 = receive.get("password2") if password == password2: random_username = get_random_username() + + default_domain_name = min( + DomainCnameInfo.objects.annotate(Count('userdomaininfo')).filter(is_enable=True, + is_system=True), + key=lambda x: x.userdomaininfo__count) + new_data = { + "username": random_username, + "password": password, + "first_name": random_username[:8], + "default_domain_name": default_domain_name + } if is_valid_email(username): - user_obj = UserInfo.objects.create_user(random_username, email=username, password=password, - first_name=random_username[:8]) + user_obj = UserInfo.objects.create_user(**new_data, email=username) elif is_valid_phone(username): - user_obj = UserInfo.objects.create_user(random_username, mobile=username, password=password, - first_name=random_username[:8]) + user_obj = UserInfo.objects.create_user(**new_data, mobile=username) else: user_obj = None response.msg = "注册异常" diff --git a/fir_ser/dumpdata.json b/fir_ser/dumpdata.json new file mode 100644 index 0000000..2f955fb --- /dev/null +++ b/fir_ser/dumpdata.json @@ -0,0 +1,92 @@ +[ + { + "model": "api.price", + "pk": 1, + "fields": { + "name": "1k_times", + "title": "1k_times", + "description": "1k_times", + "price": 2000, + "package_size": 1000, + "download_count_gift": 100, + "is_enable": true, + "updated_time": "2021-04-14T17:37:05.512" + } + }, + { + "model": "api.price", + "pk": 2, + "fields": { + "name": "10k_times", + "title": "10k_times", + "description": "10k_times", + "price": 20000, + "package_size": 10000, + "download_count_gift": 800, + "is_enable": true, + "updated_time": "2021-03-30T12:21:17.789" + } + }, + { + "model": "api.price", + "pk": 3, + "fields": { + "name": "100k_times", + "title": "100k_times", + "description": "100k_times", + "price": 200000, + "package_size": 100000, + "download_count_gift": 3000, + "is_enable": true, + "updated_time": "2021-03-29T18:28:31.942" + } + }, + { + "model": "api.domaincnameinfo", + "pk": 1, + "fields": { + "domain_record": "d.ashort.top", + "ip_address": "d.ashort.top.w.kunlunsl.com", + "is_enable": true, + "is_system": true, + "description": "d.ashort.top \u7cfb\u7edf\u81ea\u5e26\u57df\u540d\uff0c\u672a\u5907\u6848\uff0c\u56fd\u5916\u52a0\u901f\uff0c\u7528\u4e0e\u4e0b\u8f7d\u9875\u8df3\u8f6c\u57df\u540d", + "created_time": "2021-05-21T21:25:33" + } + }, + { + "model": "api.domaincnameinfo", + "pk": 2, + "fields": { + "domain_record": "d.bshort.top", + "ip_address": "d.bshort.top.w.kunlunsl.com", + "is_enable": true, + "is_system": true, + "description": "d.bshort.top \u7cfb\u7edf\u81ea\u5e26\u57df\u540d\uff0c\u672a\u5907\u6848\uff0c\u56fd\u5916\u52a0\u901f\uff0c\u7528\u4e0e\u4e0b\u8f7d\u9875\u8df3\u8f6c\u57df\u540d", + "created_time": "2021-05-21T21:25:33" + } + }, + { + "model": "api.domaincnameinfo", + "pk": 3, + "fields": { + "domain_record": "d.cshort.top", + "ip_address": "d.cshort.top.w.kunlunsl.com", + "is_enable": true, + "is_system": true, + "description": "d.cshort.top \u7cfb\u7edf\u81ea\u5e26\u57df\u540d\uff0c\u672a\u5907\u6848\uff0c\u56fd\u5916\u52a0\u901f\uff0c\u7528\u4e0e\u4e0b\u8f7d\u9875\u8df3\u8f6c\u57df\u540d", + "created_time": "2021-05-21T21:25:33" + } + }, + { + "model": "api.domaincnameinfo", + "pk": 4, + "fields": { + "domain_record": "d.eshort.top", + "ip_address": "d.eshort.top.w.kunlunsl.com", + "is_enable": true, + "is_system": true, + "description": "d.eshort.top \u7cfb\u7edf\u81ea\u5e26\u57df\u540d\uff0c\u672a\u5907\u6848\uff0c\u56fd\u5916\u52a0\u901f\uff0c\u7528\u4e0e\u4e0b\u8f7d\u9875\u8df3\u8f6c\u57df\u540d", + "created_time": "2021-05-21T21:25:33" + } + } +] \ No newline at end of file