|
|
@ -6,8 +6,8 @@ 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 |
|
|
|
from django.contrib.auth.models import AbstractUser |
|
|
|
|
|
|
|
|
|
|
|
######################################## 用户表 ######################################## |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######################################## 用户表 ######################################## |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UserInfo(AbstractUser): |
|
|
|
class UserInfo(AbstractUser): |
|
|
@ -55,6 +55,7 @@ class UserInfo(AbstractUser): |
|
|
|
self.uid = make_random_uuid() |
|
|
|
self.uid = make_random_uuid() |
|
|
|
super(UserInfo, self).save(*args, **kwargs) |
|
|
|
super(UserInfo, self).save(*args, **kwargs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Token(models.Model): |
|
|
|
class Token(models.Model): |
|
|
|
""" |
|
|
|
""" |
|
|
|
The default authorization token model. |
|
|
|
The default authorization token model. |
|
|
@ -108,13 +109,14 @@ class Apps(models.Model): |
|
|
|
issupersign = models.BigIntegerField(verbose_name="是否超级签名包", default=False) |
|
|
|
issupersign = models.BigIntegerField(verbose_name="是否超级签名包", default=False) |
|
|
|
description = models.TextField('描述', blank=True, null=True, default=None, ) |
|
|
|
description = models.TextField('描述', blank=True, null=True, default=None, ) |
|
|
|
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") |
|
|
|
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") |
|
|
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
class Meta: |
|
|
|
verbose_name = '应用信息' |
|
|
|
verbose_name = '应用信息' |
|
|
|
verbose_name_plural = "应用信息" |
|
|
|
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): |
|
|
|
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): |
|
|
|
class AppReleaseInfo(models.Model): |
|
|
@ -151,7 +153,8 @@ class AppStorage(models.Model): |
|
|
|
access_key = models.CharField(max_length=128, blank=True, null=True, verbose_name="存储访问key") |
|
|
|
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") |
|
|
|
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") |
|
|
|
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,可以自定义端口') |
|
|
|
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") |
|
|
|
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) |
|
|
|
help_text='阿里云:{"sts_role_arn":"arn信息","endpoint":""} ', default=None) |
|
|
@ -166,6 +169,7 @@ class AppStorage(models.Model): |
|
|
|
def __str__(self): |
|
|
|
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): |
|
|
|
class AppUDID(models.Model): |
|
|
|
app_id = models.ForeignKey(to="Apps", on_delete=models.CASCADE, verbose_name="属于哪个APP") |
|
|
|
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) |
|
|
@ -179,7 +183,6 @@ class AppUDID(models.Model): |
|
|
|
is_signed = models.BooleanField(verbose_name="是否完成签名打包", default=False) |
|
|
|
is_signed = models.BooleanField(verbose_name="是否完成签名打包", default=False) |
|
|
|
binary_file = models.CharField(max_length=128, blank=True, verbose_name="签名包名称", null=True) |
|
|
|
binary_file = models.CharField(max_length=128, blank=True, verbose_name="签名包名称", null=True) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
class Meta: |
|
|
|
verbose_name = '设备详情' |
|
|
|
verbose_name = '设备详情' |
|
|
|
verbose_name_plural = "设备详情" |
|
|
|
verbose_name_plural = "设备详情" |
|
|
@ -188,6 +191,7 @@ class AppUDID(models.Model): |
|
|
|
def __str__(self): |
|
|
|
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): |
|
|
|
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( |
|
|
|
email = models.EmailField( |
|
|
@ -210,11 +214,10 @@ class AppIOSDeveloperInfo(models.Model): |
|
|
|
verbose_name_plural = "苹果开发者账户" |
|
|
|
verbose_name_plural = "苹果开发者账户" |
|
|
|
unique_together = ('user_id', 'email',) |
|
|
|
unique_together = ('user_id', 'email',) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
def __str__(self): |
|
|
|
return "%s-%s" % (self.user_id, self.email) |
|
|
|
return "%s-%s" % (self.user_id, self.email) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class APPSuperSignUsedInfo(models.Model): |
|
|
|
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") |
|
|
|
app_id = models.ForeignKey(to="Apps", on_delete=models.CASCADE, verbose_name="属于哪个APP") |
|
|
@ -222,6 +225,7 @@ class APPSuperSignUsedInfo(models.Model): |
|
|
|
developerid = models.ForeignKey(to="AppIOSDeveloperInfo", on_delete=models.CASCADE, verbose_name="所使用苹果开发者账户") |
|
|
|
developerid = models.ForeignKey(to="AppIOSDeveloperInfo", on_delete=models.CASCADE, verbose_name="所使用苹果开发者账户") |
|
|
|
created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") |
|
|
|
created_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间") |
|
|
|
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") |
|
|
|
updated_time = models.DateTimeField(auto_now=True, verbose_name="更新时间") |
|
|
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
class Meta: |
|
|
|
verbose_name = '设备使用统计' |
|
|
|
verbose_name = '设备使用统计' |
|
|
|
verbose_name_plural = "设备使用统计" |
|
|
|
verbose_name_plural = "设备使用统计" |
|
|
@ -229,6 +233,7 @@ class APPSuperSignUsedInfo(models.Model): |
|
|
|
def __str__(self): |
|
|
|
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): |
|
|
|
class APPToDeveloper(models.Model): |
|
|
|
app_id = models.ForeignKey(to="Apps", on_delete=models.CASCADE, verbose_name="属于哪个APP") |
|
|
|
app_id = models.ForeignKey(to="Apps", on_delete=models.CASCADE, verbose_name="属于哪个APP") |
|
|
|
developerid = models.ForeignKey(to="AppIOSDeveloperInfo", on_delete=models.CASCADE, verbose_name="所使用苹果开发者账户") |
|
|
|
developerid = models.ForeignKey(to="AppIOSDeveloperInfo", on_delete=models.CASCADE, verbose_name="所使用苹果开发者账户") |
|
|
@ -242,3 +247,20 @@ class APPToDeveloper(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
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) |
|
|
|