+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('logs', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='mchloginfo',
+ name='operator_id',
+ field=models.CharField(blank=True, db_index=True, help_text='\u64cd\u4f5c\u5458\u552f\u4e00\u6807\u8bc6', max_length=32, null=True, verbose_name='operator_id'),
+ ),
+ ]
@@ -0,0 +1,22 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+ |
|
| 3 |
+from django.db import models |
|
| 4 |
+from django.utils.translation import ugettext_lazy as _ |
|
| 5 |
+from django_models_ext import BaseModelMixin, upload_file_url, upload_path |
|
| 6 |
+from shortuuidfield import ShortUUIDField |
|
| 7 |
+ |
|
| 8 |
+ |
|
| 9 |
+class MchLogInfo(BaseModelMixin): |
|
| 10 |
+ log_id = ShortUUIDField(_(u'log_id'), max_length=32, help_text=u'日志唯一标识', db_index=True) |
|
| 11 |
+ log_file = models.FileField(_(u'log_file'), upload_to=upload_path, blank=True, null=True, help_text=u'日志文件') |
|
| 12 |
+ |
|
| 13 |
+ operator_id = models.CharField(_(u'operator_id'), max_length=32, blank=True, null=True, help_text=u'操作员唯一标识', db_index=True) |
|
| 14 |
+ |
|
| 15 |
+ app_version = models.IntegerField(_(u'app_version'), default=0, help_text=u'APP 版本号', db_index=True) |
|
| 16 |
+ |
|
| 17 |
+ class Meta: |
|
| 18 |
+ verbose_name = _(u'mchloginfo') |
|
| 19 |
+ verbose_name_plural = _(u'mchloginfo') |
|
| 20 |
+ |
|
| 21 |
+ def __unicode__(self): |
|
| 22 |
+ return unicode(self.pk) |
@@ -0,0 +1,7 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+from __future__ import unicode_literals |
|
| 3 |
+ |
|
| 4 |
+from django.test import TestCase |
|
| 5 |
+ |
|
| 6 |
+ |
|
| 7 |
+# Create your tests here. |
@@ -0,0 +1,7 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+from __future__ import unicode_literals |
|
| 3 |
+ |
|
| 4 |
+from django.shortcuts import render |
|
| 5 |
+ |
|
| 6 |
+ |
|
| 7 |
+# Create your views here. |
@@ -13,6 +13,7 @@ from TimeConvert import TimeConvert as tc |
||
| 13 | 13 |
|
| 14 | 14 |
from account.models import UserInfo |
| 15 | 15 |
from statistic.models import RegisterStatisticInfo |
| 16 |
+from utils.error.errno_utils import ProductBrandStatusCode |
|
| 16 | 17 |
from utils.redis.connect import r |
| 17 | 18 |
from utils.redis.rprofile import set_profile_info |
| 18 | 19 |
|
@@ -23,6 +24,11 @@ WECHAT = settings.WECHAT |
||
| 23 | 24 |
@logit |
| 24 | 25 |
@transaction.atomic |
| 25 | 26 |
def get_userinfo_api(request): |
| 27 |
+ brand_id = request.POST.get('brand_id', settings.KODO_DEFAULT_BRAND_ID)
|
|
| 28 |
+ |
|
| 29 |
+ if brand_id != settings.KODO_DEFAULT_BRAND_ID: |
|
| 30 |
+ return response(ProductBrandStatusCode.BRAND_NOT_MATCH) |
|
| 31 |
+ |
|
| 26 | 32 |
wxcfg = WECHAT.get('MINIAPP', {})
|
| 27 | 33 |
|
| 28 | 34 |
appid = wxcfg.get('appID')
|
@@ -18,6 +18,7 @@ class SaleclerkStatusCode(BaseStatusCode): |
||
| 18 | 18 |
class ProductBrandStatusCode(BaseStatusCode): |
| 19 | 19 |
""" 品牌相关错误码 5010xx """ |
| 20 | 20 |
BRAND_NOT_FOUND = StatusCodeField(501001, 'Brand Not Found', description=u'品牌不存在') |
| 21 |
+ BRAND_NOT_MATCH = StatusCodeField(501011, 'Brand Not Match', description=u'品牌不匹配') |
|
| 21 | 22 |
|
| 22 | 23 |
|
| 23 | 24 |
class ProductModelStatusCode(BaseStatusCode): |