|
|
|
@ -3,11 +3,11 @@ from django.db import models |
|
|
|
|
# Create your models here. |
|
|
|
|
|
|
|
|
|
from django.contrib.contenttypes.models import ContentType |
|
|
|
|
from api.utils.app.randomstrings import make_random_uuid,make_app_uuid |
|
|
|
|
from api.utils.app.randomstrings import make_random_uuid, make_app_uuid |
|
|
|
|
from django.contrib.auth.models import AbstractUser |
|
|
|
|
|
|
|
|
|
######################################## 用户表 ######################################## |
|
|
|
|
|
|
|
|
|
######################################## 用户表 ######################################## |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UserInfo(AbstractUser): |
|
|
|
@ -19,7 +19,7 @@ class UserInfo(AbstractUser): |
|
|
|
|
blank=True, |
|
|
|
|
null=True |
|
|
|
|
) |
|
|
|
|
uid = models.CharField(max_length=64, unique=True,db_index=True) # user_id,唯一标识 |
|
|
|
|
uid = models.CharField(max_length=64, unique=True, db_index=True) # user_id,唯一标识 |
|
|
|
|
mobile = models.BigIntegerField(verbose_name="手机", unique=True, help_text="用于手机验证码登录", null=True) |
|
|
|
|
qq = models.BigIntegerField(verbose_name="QQ", blank=True, null=True, db_index=True) |
|
|
|
|
is_active = models.BooleanField(default=True, verbose_name="账户状态,默认启用") |
|
|
|
@ -38,10 +38,10 @@ class UserInfo(AbstractUser): |
|
|
|
|
date_joined = models.DateTimeField(auto_now_add=True, verbose_name="注册时间") |
|
|
|
|
download_times = models.IntegerField(default=100, verbose_name="下载次数") |
|
|
|
|
all_download_times = models.BigIntegerField(default=0, verbose_name="总共下载次数") |
|
|
|
|
domain_name = models.CharField(verbose_name="域名",blank=True,null=True,max_length=64) |
|
|
|
|
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) |
|
|
|
|
domain_name = models.CharField(verbose_name="域名", blank=True, null=True, max_length=64) |
|
|
|
|
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) |
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
|
verbose_name = '账户信息' |
|
|
|
@ -55,6 +55,7 @@ class UserInfo(AbstractUser): |
|
|
|
|
self.uid = make_random_uuid() |
|
|
|
|
super(UserInfo, self).save(*args, **kwargs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Token(models.Model): |
|
|
|
|
""" |
|
|
|
|
The default authorization token model. |
|
|
|
@ -92,43 +93,44 @@ class VerifyName(models.Model): |
|
|
|
|
######################################## APP表 ######################################## |
|
|
|
|
|
|
|
|
|
class Apps(models.Model): |
|
|
|
|
app_id = models.CharField(max_length=64, unique=True,db_index=True) # ,唯一标识 |
|
|
|
|
user_id = models.ForeignKey(to="UserInfo",verbose_name="用户ID",on_delete=models.CASCADE) |
|
|
|
|
type_choices = ((0, 'android'),(1, 'ios')) |
|
|
|
|
app_id = models.CharField(max_length=64, unique=True, db_index=True) # ,唯一标识 |
|
|
|
|
user_id = models.ForeignKey(to="UserInfo", verbose_name="用户ID", on_delete=models.CASCADE) |
|
|
|
|
type_choices = ((0, 'android'), (1, 'ios')) |
|
|
|
|
type = models.SmallIntegerField(choices=type_choices, default=0, verbose_name="类型") |
|
|
|
|
name = models.CharField(max_length=32,blank=True, null=True,verbose_name="应用名称") |
|
|
|
|
short = models.CharField(max_length=16,unique=True,verbose_name="短链接",db_index=True) |
|
|
|
|
bundle_id = models.CharField(max_length=64,blank=True,verbose_name="bundle id") |
|
|
|
|
name = models.CharField(max_length=32, blank=True, null=True, verbose_name="应用名称") |
|
|
|
|
short = models.CharField(max_length=16, unique=True, verbose_name="短链接", db_index=True) |
|
|
|
|
bundle_id = models.CharField(max_length=64, blank=True, verbose_name="bundle id") |
|
|
|
|
has_combo = models.OneToOneField(to="Apps", related_name='combo_app_info', |
|
|
|
|
verbose_name="关联应用",on_delete=models.SET_NULL,null=True,blank=True) |
|
|
|
|
verbose_name="关联应用", on_delete=models.SET_NULL, null=True, blank=True) |
|
|
|
|
created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") |
|
|
|
|
count_hits = models.BigIntegerField(verbose_name="下载次数",default=0) |
|
|
|
|
password = models.CharField(verbose_name="访问密码",default='',help_text='默认 没有密码',max_length=32) |
|
|
|
|
isshow = models.BigIntegerField(verbose_name="下载页可见",default=1) |
|
|
|
|
issupersign = models.BigIntegerField(verbose_name="是否超级签名包",default=False) |
|
|
|
|
count_hits = models.BigIntegerField(verbose_name="下载次数", default=0) |
|
|
|
|
password = models.CharField(verbose_name="访问密码", default='', help_text='默认 没有密码', max_length=32) |
|
|
|
|
isshow = models.BigIntegerField(verbose_name="下载页可见", default=1) |
|
|
|
|
issupersign = models.BigIntegerField(verbose_name="是否超级签名包", default=False) |
|
|
|
|
description = models.TextField('描述', blank=True, null=True, default=None, ) |
|
|
|
|
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") |
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
|
verbose_name = '应用信息' |
|
|
|
|
verbose_name_plural = "应用信息" |
|
|
|
|
indexes = [models.Index(fields=['app_id']),models.Index(fields=['id','user_id','type'])] |
|
|
|
|
indexes = [models.Index(fields=['app_id']), models.Index(fields=['id', 'user_id', 'type'])] |
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
return "%s %s-%s %s %s" % (self.name,self.get_type_display(),self.short,self.has_combo,self.issupersign) |
|
|
|
|
return "%s %s-%s %s" % (self.name, self.get_type_display(), self.short, self.issupersign) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AppReleaseInfo(models.Model): |
|
|
|
|
is_master = models.BooleanField(verbose_name="是否master版本",default=True) |
|
|
|
|
release_id = models.CharField(max_length=64, unique=True,verbose_name="release 版本id",db_index=True) |
|
|
|
|
app_id = models.ForeignKey(to="Apps",on_delete=models.CASCADE,verbose_name="属于哪个APP") |
|
|
|
|
build_version = models.CharField(max_length=16,verbose_name="build版本",blank=True) |
|
|
|
|
app_version = models.CharField(max_length=16,verbose_name="app版本",blank=True) |
|
|
|
|
release_choices=((0,'android'),(1,'adhoc'),(2,'Inhouse'),(3,'unknown')) |
|
|
|
|
is_master = models.BooleanField(verbose_name="是否master版本", default=True) |
|
|
|
|
release_id = models.CharField(max_length=64, unique=True, verbose_name="release 版本id", db_index=True) |
|
|
|
|
app_id = models.ForeignKey(to="Apps", on_delete=models.CASCADE, verbose_name="属于哪个APP") |
|
|
|
|
build_version = models.CharField(max_length=16, verbose_name="build版本", blank=True) |
|
|
|
|
app_version = models.CharField(max_length=16, verbose_name="app版本", blank=True) |
|
|
|
|
release_choices = ((0, 'android'), (1, 'adhoc'), (2, 'Inhouse'), (3, 'unknown')) |
|
|
|
|
release_type = models.SmallIntegerField(choices=release_choices, default=0, verbose_name="版本类型") |
|
|
|
|
minimum_os_version = models.CharField(max_length=64,verbose_name="应用可安装的最低系统版本") |
|
|
|
|
minimum_os_version = models.CharField(max_length=64, verbose_name="应用可安装的最低系统版本") |
|
|
|
|
binary_size = models.BigIntegerField(verbose_name="应用大小") |
|
|
|
|
binary_url = models.CharField(max_length=128,blank=True,verbose_name="第三方下载URL") |
|
|
|
|
icon_url = models.CharField(max_length=128,blank=True,verbose_name="图标url") |
|
|
|
|
binary_url = models.CharField(max_length=128, blank=True, verbose_name="第三方下载URL") |
|
|
|
|
icon_url = models.CharField(max_length=128, blank=True, verbose_name="图标url") |
|
|
|
|
changelog = models.TextField('更新日志', blank=True, null=True, default=None, ) |
|
|
|
|
udid = models.TextField('ios内测版 udid', blank=True, null=True, default='', ) |
|
|
|
|
|
|
|
|
@ -143,17 +145,18 @@ class AppReleaseInfo(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AppStorage(models.Model): |
|
|
|
|
user_id = models.ForeignKey(to="UserInfo",verbose_name="用户ID",on_delete=models.CASCADE) |
|
|
|
|
name = models.CharField(max_length=64,blank=True, null=True, verbose_name="存储名字") |
|
|
|
|
user_id = models.ForeignKey(to="UserInfo", verbose_name="用户ID", on_delete=models.CASCADE) |
|
|
|
|
name = models.CharField(max_length=64, blank=True, null=True, verbose_name="存储名字") |
|
|
|
|
# is_used = models.BooleanField(verbose_name="是否使用该存储",default=True) |
|
|
|
|
storage_choices=((0,'本地存储'),(1,'七牛云存储'),(2,'阿里云存储'),(3,'默认存储')) |
|
|
|
|
storage_choices = ((0, '本地存储'), (1, '七牛云存储'), (2, '阿里云存储'), (3, '默认存储')) |
|
|
|
|
storage_type = models.SmallIntegerField(choices=storage_choices, default=3, verbose_name="存储类型") |
|
|
|
|
access_key =models.CharField(max_length=128,blank=True, null=True, verbose_name="存储访问key") |
|
|
|
|
secret_key =models.CharField(max_length=128,blank=True, null=True, verbose_name="存储访问secret") |
|
|
|
|
bucket_name=models.CharField(max_length=128,blank=True, null=True, verbose_name="存储空间bucket_name") |
|
|
|
|
domain_name=models.CharField(max_length=128,blank=True, null=True, verbose_name="下载域名",help_text='fly-storage.dvcloud.xin,可以自定义端口') |
|
|
|
|
access_key = models.CharField(max_length=128, blank=True, null=True, verbose_name="存储访问key") |
|
|
|
|
secret_key = models.CharField(max_length=128, blank=True, null=True, verbose_name="存储访问secret") |
|
|
|
|
bucket_name = models.CharField(max_length=128, blank=True, null=True, verbose_name="存储空间bucket_name") |
|
|
|
|
domain_name = models.CharField(max_length=128, blank=True, null=True, verbose_name="下载域名", |
|
|
|
|
help_text='fly-storage.dvcloud.xin,可以自定义端口') |
|
|
|
|
is_https = models.BooleanField(default=True, verbose_name="是否支持https") |
|
|
|
|
additionalparameters = models.TextField(blank=True, null=True,verbose_name="额外参数", |
|
|
|
|
additionalparameters = models.TextField(blank=True, null=True, verbose_name="额外参数", |
|
|
|
|
help_text='阿里云:{"sts_role_arn":"arn信息","endpoint":""} ', default=None) |
|
|
|
|
created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") |
|
|
|
|
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") |
|
|
|
@ -164,21 +167,21 @@ class AppStorage(models.Model): |
|
|
|
|
verbose_name_plural = "存储配置" |
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
return "%s %s" % (self.user_id.get_username(),self.name) |
|
|
|
|
return "%s %s" % (self.user_id.get_username(), self.name) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AppUDID(models.Model): |
|
|
|
|
app_id = models.ForeignKey(to="Apps", on_delete=models.CASCADE, verbose_name="属于哪个APP") |
|
|
|
|
udid = models.CharField(max_length=64,verbose_name="udid唯一标识",db_index=True) |
|
|
|
|
udid = models.CharField(max_length=64, verbose_name="udid唯一标识", db_index=True) |
|
|
|
|
product = models.CharField(max_length=64, verbose_name="产品", blank=True, null=True, ) |
|
|
|
|
serial = models.CharField(max_length=64, verbose_name="序列号", blank=True, null=True, ) |
|
|
|
|
version = models.CharField(max_length=64, verbose_name="型号", blank=True, null=True, ) |
|
|
|
|
imei= models.CharField(max_length=64, verbose_name="型号", blank=True, null=True, ) |
|
|
|
|
iccid= models.CharField(max_length=64, verbose_name="型号", blank=True, null=True, ) |
|
|
|
|
imei = models.CharField(max_length=64, verbose_name="型号", blank=True, null=True, ) |
|
|
|
|
iccid = models.CharField(max_length=64, verbose_name="型号", blank=True, null=True, ) |
|
|
|
|
created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") |
|
|
|
|
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") |
|
|
|
|
is_signed = models.BooleanField(verbose_name="是否完成签名打包",default=False) |
|
|
|
|
binary_file = models.CharField(max_length=128,blank=True,verbose_name="签名包名称",null=True) |
|
|
|
|
|
|
|
|
|
is_signed = models.BooleanField(verbose_name="是否完成签名打包", default=False) |
|
|
|
|
binary_file = models.CharField(max_length=128, blank=True, verbose_name="签名包名称", null=True) |
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
|
verbose_name = '设备详情' |
|
|
|
@ -186,21 +189,22 @@ class AppUDID(models.Model): |
|
|
|
|
unique_together = ('app_id', 'udid',) |
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
return "%s-%s" % (self.app_id.name,self.udid) |
|
|
|
|
return "%s-%s" % (self.app_id.name, self.udid) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AppIOSDeveloperInfo(models.Model): |
|
|
|
|
user_id = models.ForeignKey(to="UserInfo",verbose_name="用户ID",on_delete=models.CASCADE) |
|
|
|
|
user_id = models.ForeignKey(to="UserInfo", verbose_name="用户ID", on_delete=models.CASCADE) |
|
|
|
|
email = models.EmailField( |
|
|
|
|
verbose_name='email address', |
|
|
|
|
max_length=64, |
|
|
|
|
blank=True, |
|
|
|
|
null=True |
|
|
|
|
) |
|
|
|
|
password = models.CharField(max_length=64,) |
|
|
|
|
is_actived = models.BooleanField(default=False,verbose_name="是否已经激活") |
|
|
|
|
certid = models.CharField(max_length=64,blank=True,verbose_name="超级签名自动创建证书ID",null=True) |
|
|
|
|
usable_number = models.IntegerField(verbose_name="可使用设备数",default=100) |
|
|
|
|
use_number = models.IntegerField(verbose_name="已消耗设备数",default=0) |
|
|
|
|
password = models.CharField(max_length=64, ) |
|
|
|
|
is_actived = models.BooleanField(default=False, verbose_name="是否已经激活") |
|
|
|
|
certid = models.CharField(max_length=64, blank=True, verbose_name="超级签名自动创建证书ID", null=True) |
|
|
|
|
usable_number = models.IntegerField(verbose_name="可使用设备数", default=100) |
|
|
|
|
use_number = models.IntegerField(verbose_name="已消耗设备数", default=0) |
|
|
|
|
created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") |
|
|
|
|
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") |
|
|
|
|
description = models.TextField('备注', blank=True, null=True, default='') |
|
|
|
@ -210,30 +214,31 @@ class AppIOSDeveloperInfo(models.Model): |
|
|
|
|
verbose_name_plural = "苹果开发者账户" |
|
|
|
|
unique_together = ('user_id', 'email',) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
return "%s-%s" % (self.user_id,self.email) |
|
|
|
|
return "%s-%s" % (self.user_id, self.email) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class APPSuperSignUsedInfo(models.Model): |
|
|
|
|
user_id = models.ForeignKey(to="UserInfo",verbose_name="用户ID",on_delete=models.CASCADE) |
|
|
|
|
user_id = models.ForeignKey(to="UserInfo", verbose_name="用户ID", on_delete=models.CASCADE) |
|
|
|
|
app_id = models.ForeignKey(to="Apps", on_delete=models.CASCADE, verbose_name="属于哪个APP") |
|
|
|
|
udid = models.ForeignKey(to="AppUDID",on_delete=models.CASCADE, verbose_name="所消耗的udid") |
|
|
|
|
developerid = models.ForeignKey(to="AppIOSDeveloperInfo",on_delete=models.CASCADE, verbose_name="所使用苹果开发者账户") |
|
|
|
|
udid = models.ForeignKey(to="AppUDID", on_delete=models.CASCADE, verbose_name="所消耗的udid") |
|
|
|
|
developerid = models.ForeignKey(to="AppIOSDeveloperInfo", on_delete=models.CASCADE, verbose_name="所使用苹果开发者账户") |
|
|
|
|
created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") |
|
|
|
|
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") |
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
|
verbose_name = '设备使用统计' |
|
|
|
|
verbose_name_plural = "设备使用统计" |
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
return "%s-%s-%s" % (self.user_id,self.app_id,self.udid) |
|
|
|
|
return "%s-%s-%s" % (self.user_id, self.app_id, self.udid) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class APPToDeveloper(models.Model): |
|
|
|
|
app_id = models.ForeignKey(to="Apps", on_delete=models.CASCADE, verbose_name="属于哪个APP") |
|
|
|
|
developerid = models.ForeignKey(to="AppIOSDeveloperInfo",on_delete=models.CASCADE, verbose_name="所使用苹果开发者账户") |
|
|
|
|
binary_file = models.CharField(max_length=128,blank=True,verbose_name="签名包名称",null=True,unique=True) |
|
|
|
|
release_file = models.CharField(max_length=128,blank=True,verbose_name="源包名称",null=True) |
|
|
|
|
developerid = models.ForeignKey(to="AppIOSDeveloperInfo", on_delete=models.CASCADE, verbose_name="所使用苹果开发者账户") |
|
|
|
|
binary_file = models.CharField(max_length=128, blank=True, verbose_name="签名包名称", null=True, unique=True) |
|
|
|
|
release_file = models.CharField(max_length=128, blank=True, verbose_name="源包名称", null=True) |
|
|
|
|
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") |
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
@ -241,4 +246,21 @@ class APPToDeveloper(models.Model): |
|
|
|
|
verbose_name_plural = "应用开发者绑定" |
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
return "%s-%s-%s" % (self.developerid,self.app_id,self.binary_file) |
|
|
|
|
return "%s-%s-%s" % (self.developerid, self.app_id, self.binary_file) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UDIDsyncDeveloper(models.Model): |
|
|
|
|
developerid = models.ForeignKey(to="AppIOSDeveloperInfo", on_delete=models.CASCADE, verbose_name="所使用苹果开发者账户") |
|
|
|
|
udid = models.CharField(max_length=64, verbose_name="udid唯一标识", db_index=True) |
|
|
|
|
product = models.CharField(max_length=64, verbose_name="产品", blank=True, null=True, ) |
|
|
|
|
serial = models.CharField(max_length=64, verbose_name="序列号", blank=True, null=True, ) |
|
|
|
|
version = models.CharField(max_length=64, verbose_name="型号", blank=True, null=True, ) |
|
|
|
|
created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") |
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
|
verbose_name = 'iOS开发平台同步设备信息' |
|
|
|
|
verbose_name_plural = "iOS开发平台同步设备信息" |
|
|
|
|
unique_together = ('udid', 'developerid',) |
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
return "%s-%s-%s" % (self.product, self.udid, self.developerid) |
|
|
|
|