|
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_models_ext import BaseModelMixin, upload_file_url, upload_path
from shortuuidfield import ShortUUIDField
class MchInfoEncryptLogInfo(BaseModelMixin):
plaintext = models.CharField(_(u'plaintext'), max_length=64, blank=True, null=True, help_text=u'待加密字符串', db_index=True, unique=True)
alg = models.CharField(_(u'alg'), max_length=16, blank=True, null=True, help_text=u'加密算法')
ciphertext = models.CharField(_(u'ciphertext'), max_length=64, blank=True, null=True, help_text=u'加密字符串')
brand_pk = models.IntegerField(_(u'brand_pk'), default=0, help_text=u'品牌PK', db_index=True)
model_pk = models.IntegerField(_(u'model_pk'), default=0, help_text=u'型号PK', db_index=True)
distributor_pk = models.IntegerField(_(u'distributor_pk'), default=0, help_text=u'经销商PK', db_index=True)
sn = models.CharField(_(u'sn'), max_length=32, blank=True, null=True, help_text=u'序列号', db_index=True)
#二维码版本
version=models.IntegerField(_(u'version'), default=2, help_text=u'二维码版本', db_index=True)
# 一物一码
application_id = models.IntegerField(_(u'application_id'), default=0, help_text=u'申请单号', db_index=True)
code = models.CharField(_(u'code'), max_length=16, blank=True, null=True, help_text=u'九位的字符串原始码', db_index=True)
code_url = models.CharField(_(u'code_url'), max_length=128, blank=True, null=True, help_text=u'28位普通码字符 ', db_index=True)
operator_id = models.CharField(_(u'operator_id'), max_length=32, blank=True, null=True, help_text=u'操作员唯一标识', db_index=True)
class Meta:
verbose_name = _(u'mchinfoencryptloginfo')
verbose_name_plural = _(u'mchinfoencryptloginfo')
def __unicode__(self):
return unicode(self.pk)
class MchInfoDecryptLogInfo(BaseModelMixin):
ciphertext = models.CharField(_(u'ciphertext'), max_length=64, blank=True, null=True, help_text=u'待解密字符串', db_index=True)
brand_pk = models.IntegerField(_(u'brand_pk'), default=0, help_text=u'品牌PK', db_index=True)
model_pk = models.IntegerField(_(u'model_pk'), default=0, help_text=u'型号PK', db_index=True)
distributor_pk = models.IntegerField(_(u'distributor_pk'), default=0, help_text=u'经销商PK', db_index=True)
sn = models.CharField(_(u'sn'), max_length=32, blank=True, null=True, help_text=u'序列号', db_index=True)
# 一物一码
application_id = models.IntegerField(_(u'application_id'), default=0, help_text=u'申请单号', db_index=True)
code = models.CharField(_(u'code'), max_length=16, blank=True, null=True, help_text=u'九位的字符串原始码', db_index=True)
code_url = models.CharField(_(u'code_url'), max_length=128, blank=True, null=True, help_text=u'28位普通码字符 ', db_index=True)
decrypt_count = models.IntegerField(_(u'decrypt_count'), default=1, help_text=u'解密次数')
class Meta:
verbose_name = _(u'mchinfodecryptloginfo')
verbose_name_plural = _(u'mchinfodecryptloginfo')
def __unicode__(self):
return unicode(self.pk)
class MchLogInfo(BaseModelMixin):
log_id = ShortUUIDField(_(u'log_id'), max_length=32, help_text=u'日志唯一标识', db_index=True)
log_file = models.FileField(_(u'log_file'), upload_to=upload_path, blank=True, null=True, help_text=u'日志文件')
operator_id = models.CharField(_(u'operator_id'), max_length=32, blank=True, null=True, help_text=u'操作员唯一标识', db_index=True)
app_version = models.IntegerField(_(u'app_version'), default=0, help_text=u'APP 版本号', db_index=True)
class Meta:
verbose_name = _(u'mchloginfo')
verbose_name_plural = _(u'mchloginfo')
def __unicode__(self):
return unicode(self.pk)
class MchSearchModelAndCameraLogInfo(BaseModelMixin):
user_id = models.CharField(_(u'user_id'), max_length=32, blank=True, null=True, help_text=u'用户唯一标识', db_index=True)
log_id = ShortUUIDField(_(u'log_id'), max_length=32, help_text=u'日志唯一标识', db_index=True)
is_search_model = models.IntegerField(_(u'is_search_model'), default=0, help_text=u'搜索镜头型号', db_index=True)
is_selected_model = models.IntegerField(_(u'is_selected_model'), default=0, help_text=u'搜索相机型号', db_index=True)
is_search_camera = models.IntegerField(_(u'is_search_model'), default=0, help_text=u'搜索相机型号', db_index=True)
is_search_model_camera = models.IntegerField(_(u'is_search_model'), default=0, help_text=u'搜索相机型号和镜头型号', db_index=True)
is_search_camera_after_model = models.IntegerField(_(u'is_search_camera_after_model'), default=0, help_text=u'选择镜头后搜索相机型号', db_index=True)
class Meta:
verbose_name = _(u'mchsearchmodelandcameraloginfo')
verbose_name_plural = _(u'mchsearchmodelandcameraloginfo')
def __unicode__(self):
return unicode(self.pk)
|