Selaa lähdekoodia

Merge branch 'dev'

WuYiPei 5 vuotta sitten
vanhempi
commit
6a6a1202d2

+ 42 - 42
Ansjer/file/apns_pem/zccloud-dev.pem

@@ -1,23 +1,23 @@
 Bag Attributes
     friendlyName: Apple Development IOS Push Services: com.ansjer.zccloud
-    localKeyID: 53 D0 A7 6B CF E9 9C 46 ED 44 01 01 01 14 02 52 A6 45 AB C5 
+    localKeyID: 25 54 61 DA 6A 7C CD 2D 6A 1E 45 64 96 7A 4B 28 89 15 73 D4 
 subject=/UID=com.ansjer.zccloud/CN=Apple Development IOS Push Services: com.ansjer.zccloud/OU=772N5HXAR2/C=US
 issuer=/C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority
 -----BEGIN CERTIFICATE-----
-MIIFiTCCBHGgAwIBAgIIcl31JS0D4/cwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV
+MIIFiTCCBHGgAwIBAgIIdGAeNPi1q4YwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV
 BAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3Js
 ZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3
 aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw
-HhcNMTkxMTA4MDc0NjI4WhcNMjAxMTA3MDc0NjI4WjCBiDEiMCAGCgmSJomT8ixk
+HhcNMjAwNDI0MDYwODU4WhcNMjEwNDI0MDYwODU4WjCBiDEiMCAGCgmSJomT8ixk
 AQEMEmNvbS5hbnNqZXIuemNjbG91ZDFAMD4GA1UEAww3QXBwbGUgRGV2ZWxvcG1l
 bnQgSU9TIFB1c2ggU2VydmljZXM6IGNvbS5hbnNqZXIuemNjbG91ZDETMBEGA1UE
 CwwKNzcyTjVIWEFSMjELMAkGA1UEBhMCVVMwgg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jL6apJ4vTFPgK+wAZ+XV8urN4m1kvV58FJDmfxaq9oJJ1
+6YKNAoGAWULDkYaRAklSkM9lGV/OWcBgH/rYZycqwRKaLRdluKoWzYqnpcF5Vj8l
+ENI854Luqo7NpoHfAhyB3TH7CFocTL6BXMO0Naf5q7nmQMqQmcHuPBhyaVCiMXBy
+4aKyiWNMt4Rn54VDbgyYklCZkg3o0kV70yAdWm5blnxnbVpOe+g=
 -----END RSA PRIVATE KEY-----

+ 5 - 1
Ansjer/urls.py

@@ -3,7 +3,7 @@ from django.urls import path, re_path
 
 from Controller import FeedBack, EquipmentOTA, EquipmentInfo, AdminManage, AppInfo, \
     AccessLog, DynamoDBLog, Test, MealManage, DeviceManage, EquipmentStatus, SysManage, DeviceLog, LogAccess, \
-    AppColophon, \
+    AppColophon, DateController,\
     EquipmentManager, LogManager, PermissionManager, OTAEquipment, shareUserPermission, UidSetController, \
     UserManger, CheckUserData, \
     UserController, CloudVod, OrderContrller, VodBucket, DetectController, DeviceShare, UserBrandController, \
@@ -194,9 +194,13 @@ urlpatterns = [
     url(r'^v3/account/changePwd$', UserController.v3ChangePwdView.as_view()),
     url(r'^v3/account/resetPwdByCode$', UserController.v3resetPwdByCodeView.as_view()),
     url(r'^v3/account/register$', UserController.v3registerView.as_view()),
+    # 判断节假日接口
+    url(r'^date/(?P<operation>.*)$', DateController.DateConView.as_view()),
+
     # app 设备消息模板
     # 路由加参数参考
     # url(r'^(?P<path>.*)/(?P<UID>.*)/lls$', Test.Test.as_view(), name=u'gg'),
+    #testing....................
     re_path('(?P<path>.*)', LogManager.errorPath),
     # test.....
     # 111111111

+ 8 - 10
Controller/CloudStorage.py

@@ -220,8 +220,8 @@ class CloudStorageView(View):
         conn = session.client('s3')
         playlist_entries = []
         for i in range(fg):
-            thumbspng = '{uid}/vod{channel}/{time}/thumbs.png'. \
-                format(uid=uid, channel=channel, time=storeTime)
+            thumbspng = '{uid}/vod{channel}/{time}/{i}.ts'. \
+                format(uid=uid, channel=channel, time=storeTime, i=i)
             response_url = conn.generate_presigned_url(
                 'get_object',
                 Params={
@@ -535,14 +535,10 @@ class CloudStorageView(View):
             dv_qs = Device_Info.objects.filter(UID=uid, userID_id=userID, isShare=False, isExist=1)
             if dv_qs.exists():
                 now_time = int(time.time())
-                try:
-                    ubqs = UID_Bucket.objects.filter(uid=uid, channel=channel, endTime__gte=now_time).first()
-                except Exception as e:
-                    print(repr(e))
-                    return response.json(10, '未购买')
-                else:
-                    ubqs.status = status
-                    ubqs.save()
+                ub_qs = UID_Bucket.objects.filter(uid=uid, channel=channel, endTime__gte=now_time)
+                if ub_qs.exists():
+                    ub_qs.status = status
+                    ub_qs.save()
                     if status == 0:
                         return response.json(0)
                     else:
@@ -554,6 +550,8 @@ class CloudStorageView(View):
                         storeHlsUrl = "{SERVER_DOMAIN}cloudstorage/storeplaylist?uidToken={uidToken}". \
                             format(uidToken=uidTK, SERVER_DOMAIN=SERVER_DOMAIN)
                         return response.json(0, {'uidTkUrl': uidTkUrl, 'storeHlsUrl': storeHlsUrl})
+                else:
+                    return response.json(10, '未购买')
             else:
                 return response.json(12)
         else:

+ 432 - 0
Controller/DateController.py

@@ -0,0 +1,432 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+"""
+@Copyright (C) ansjer cop Video Technology Co.,Ltd.All rights reserved.
+@AUTHOR: ASJRD018
+@NAME: AnsjerFormal
+@software: PyCharm
+@DATE: 2018/12/5 9:30
+@Version: python3.6
+@MODIFY DECORD:ansjer dev
+@file: CloudVod.py
+@Contact: chanjunkai@163.com
+"""
+import json
+import math
+import time
+import urllib
+from django.http import JsonResponse, HttpResponseRedirect, HttpResponse
+from django.utils.decorators import method_decorator
+from django.views.decorators.csrf import csrf_exempt
+from django.views.generic.base import View
+from Object.ResponseObject import ResponseObject
+from Object.TokenObject import TokenObject
+from Object.UidTokenObject import UidTokenObject
+from Service.CommonService import CommonService
+from Service.ModelService import ModelService
+
+
+
+class DateConView(View):
+    @method_decorator(csrf_exempt)
+    def dispatch(self, *args, **kwargs):
+        return super(DateConView, self).dispatch(*args, **kwargs)
+
+    def get(self, request, *args, **kwargs):
+        request.encoding = 'utf-8'
+        operation = kwargs.get('operation')
+        return self.validation(request.GET, request, operation)
+
+    def post(self, request, *args, **kwargs):
+        request.encoding = 'utf-8'
+        operation = kwargs.get('operation')
+        return self.validation(request.POST, request, operation)
+
+    def validation(self, request_dict, request, operation):
+        response = ResponseObject()
+        if operation is None:
+            return response.json(444, 'error path')
+        elif operation == 'day':
+            return self.do_date(request_dict, response)
+        else:
+            return response.json(414)
+
+    def do_date(self, request_dict,response):
+        h = request_dict.get('h', None)
+        day = [
+        {"dayStr": "20200101", "type": "2"},
+        {"dayStr": "20200102", "type": "0"},
+        {"dayStr": "20200103", "type": "0"},
+        {"dayStr": "20200104", "type": "1"},
+        {"dayStr": "20200105", "type": "1"},
+        {"dayStr": "20200106", "type": "0"},
+        {"dayStr": "20200107", "type": "0"},
+        {"dayStr": "20200108", "type": "0"},
+        {"dayStr": "20200109", "type": "0"},
+        {"dayStr": "20200110", "type": "0"},
+        {"dayStr": "20200111", "type": "1"},
+        {"dayStr": "20200112", "type": "1"},
+        {"dayStr": "20200113", "type": "0"},
+        {"dayStr": "20200114", "type": "0"},
+        {"dayStr": "20200115", "type": "0"},
+        {"dayStr": "20200116", "type": "0"},
+        {"dayStr": "20200117", "type": "0"},
+        {"dayStr": "20200118", "type": "1"},
+        {"dayStr": "20200119", "type": "0"},
+        {"dayStr": "20200120", "type": "0"},
+        {"dayStr": "20200121", "type": "0"},
+        {"dayStr": "20200122", "type": "0"},
+        {"dayStr": "20200123", "type": "0"},
+        {"dayStr": "20200124", "type": "2"},
+        {"dayStr": "20200125", "type": "2"},
+        {"dayStr": "20200126", "type": "2"},
+        {"dayStr": "20200127", "type": "2"},
+        {"dayStr": "20200128", "type": "2"},
+        {"dayStr": "20200129", "type": "2"},
+        {"dayStr": "20200130", "type": "2"},
+        {"dayStr": "20200131", "type": "0"},
+        {"dayStr": "20200201", "type": "0"},
+        {"dayStr": "20200202", "type": "1"},
+        {"dayStr": "20200203", "type": "0"},
+        {"dayStr": "20200204", "type": "0"},
+        {"dayStr": "20200205", "type": "0"},
+        {"dayStr": "20200206", "type": "0"},
+        {"dayStr": "20200207", "type": "0"},
+        {"dayStr": "20200208", "type": "1"},
+        {"dayStr": "20200209", "type": "1"},
+        {"dayStr": "20200210", "type": "0"},
+        {"dayStr": "20200211", "type": "0"},
+        {"dayStr": "20200212", "type": "0"},
+        {"dayStr": "20200213", "type": "0"},
+        {"dayStr": "20200214", "type": "0"},
+        {"dayStr": "20200215", "type": "1"},
+        {"dayStr": "20200216", "type": "1"},
+        {"dayStr": "20200217", "type": "0"},
+        {"dayStr": "20200218", "type": "0"},
+        {"dayStr": "20200219", "type": "0"},
+        {"dayStr": "20200220", "type": "0"},
+        {"dayStr": "20200221", "type": "0"},
+        {"dayStr": "20200222", "type": "1"},
+        {"dayStr": "20200223", "type": "1"},
+        {"dayStr": "20200224", "type": "0"},
+        {"dayStr": "20200225", "type": "0"},
+        {"dayStr": "20200226", "type": "0"},
+        {"dayStr": "20200227", "type": "0"},
+        {"dayStr": "20200228", "type": "0"},
+        {"dayStr": "20200229", "type": "1"},
+        {"dayStr": "20200301", "type": "1"},
+        {"dayStr": "20200302", "type": "0"},
+        {"dayStr": "20200303", "type": "0"},
+        {"dayStr": "20200304", "type": "0"},
+        {"dayStr": "20200305", "type": "0"},
+        {"dayStr": "20200306", "type": "0"},
+        {"dayStr": "20200307", "type": "1"},
+        {"dayStr": "20200308", "type": "1"},
+        {"dayStr": "20200309", "type": "0"},
+        {"dayStr": "20200310", "type": "0"},
+        {"dayStr": "20200311", "type": "0"},
+        {"dayStr": "20200312", "type": "0"},
+        {"dayStr": "20200313", "type": "0"},
+        {"dayStr": "20200314", "type": "1"},
+        {"dayStr": "20200315", "type": "1"},
+        {"dayStr": "20200316", "type": "0"},
+        {"dayStr": "20200317", "type": "0"},
+        {"dayStr": "20200318", "type": "0"},
+        {"dayStr": "20200319", "type": "0"},
+        {"dayStr": "20200320", "type": "0"},
+        {"dayStr": "20200321", "type": "1"},
+        {"dayStr": "20200322", "type": "1"},
+        {"dayStr": "20200323", "type": "0"},
+        {"dayStr": "20200324", "type": "0"},
+        {"dayStr": "20200325", "type": "0"},
+        {"dayStr": "20200326", "type": "0"},
+        {"dayStr": "20200327", "type": "0"},
+        {"dayStr": "20200328", "type": "1"},
+        {"dayStr": "20200329", "type": "1"},
+        {"dayStr": "20200330", "type": "0"},
+        {"dayStr": "20200331", "type": "0"},
+        {"dayStr": "20200401", "type": "0"},
+        {"dayStr": "20200402", "type": "0"},
+        {"dayStr": "20200403", "type": "0"},
+        {"dayStr": "20200404", "type": "2"},
+        {"dayStr": "20200405", "type": "2"},
+        {"dayStr": "20200406", "type": "2"},
+        {"dayStr": "20200407", "type": "0"},
+        {"dayStr": "20200408", "type": "0"},
+        {"dayStr": "20200409", "type": "0"},
+        {"dayStr": "20200410", "type": "0"},
+        {"dayStr": "20200411", "type": "1"},
+        {"dayStr": "20200412", "type": "1"},
+        {"dayStr": "20200413", "type": "0"},
+        {"dayStr": "20200414", "type": "0"},
+        {"dayStr": "20200415", "type": "0"},
+        {"dayStr": "20200416", "type": "0"},
+        {"dayStr": "20200417", "type": "0"},
+        {"dayStr": "20200418", "type": "1"},
+        {"dayStr": "20200419", "type": "1"},
+        {"dayStr": "20200420", "type": "0"},
+        {"dayStr": "20200421", "type": "0"},
+        {"dayStr": "20200422", "type": "0"},
+        {"dayStr": "20200423", "type": "0"},
+        {"dayStr": "20200424", "type": "0"},
+        {"dayStr": "20200425", "type": "1"},
+        {"dayStr": "20200426", "type": "0"},
+        {"dayStr": "20200427", "type": "0"},
+        {"dayStr": "20200428", "type": "0"},
+        {"dayStr": "20200429", "type": "0"},
+        {"dayStr": "20200430", "type": "0"},
+        {"dayStr": "20200501", "type": "2"},
+        {"dayStr": "20200502", "type": "2"},
+        {"dayStr": "20200503", "type": "2"},
+        {"dayStr": "20200504", "type": "2"},
+        {"dayStr": "20200505", "type": "2"},
+        {"dayStr": "20200506", "type": "0"},
+        {"dayStr": "20200507", "type": "0"},
+        {"dayStr": "20200508", "type": "0"},
+        {"dayStr": "20200509", "type": "0"},
+        {"dayStr": "20200510", "type": "1"},
+        {"dayStr": "20200511", "type": "0"},
+        {"dayStr": "20200512", "type": "0"},
+        {"dayStr": "20200513", "type": "0"},
+        {"dayStr": "20200514", "type": "0"},
+        {"dayStr": "20200515", "type": "0"},
+        {"dayStr": "20200516", "type": "1"},
+        {"dayStr": "20200517", "type": "1"},
+        {"dayStr": "20200518", "type": "0"},
+        {"dayStr": "20200519", "type": "0"},
+        {"dayStr": "20200520", "type": "0"},
+        {"dayStr": "20200521", "type": "0"},
+        {"dayStr": "20200522", "type": "0"},
+        {"dayStr": "20200523", "type": "1"},
+        {"dayStr": "20200524", "type": "1"},
+        {"dayStr": "20200525", "type": "0"},
+        {"dayStr": "20200526", "type": "0"},
+        {"dayStr": "20200527", "type": "0"},
+        {"dayStr": "20200528", "type": "0"},
+        {"dayStr": "20200529", "type": "0"},
+        {"dayStr": "20200530", "type": "1"},
+        {"dayStr": "20200531", "type": "1"},
+        {"dayStr": "20200601", "type": "0"},
+        {"dayStr": "20200602", "type": "0"},
+        {"dayStr": "20200603", "type": "0"},
+        {"dayStr": "20200604", "type": "0"},
+        {"dayStr": "20200605", "type": "0"},
+        {"dayStr": "20200606", "type": "1"},
+        {"dayStr": "20200607", "type": "1"},
+        {"dayStr": "20200608", "type": "0"},
+        {"dayStr": "20200609", "type": "0"},
+        {"dayStr": "20200610", "type": "0"},
+        {"dayStr": "20200611", "type": "0"},
+        {"dayStr": "20200612", "type": "0"},
+        {"dayStr": "20200613", "type": "1"},
+        {"dayStr": "20200614", "type": "1"},
+        {"dayStr": "20200615", "type": "0"},
+        {"dayStr": "20200616", "type": "0"},
+        {"dayStr": "20200617", "type": "0"},
+        {"dayStr": "20200618", "type": "0"},
+        {"dayStr": "20200619", "type": "0"},
+        {"dayStr": "20200620", "type": "1"},
+        {"dayStr": "20200621", "type": "1"},
+        {"dayStr": "20200622", "type": "0"},
+        {"dayStr": "20200623", "type": "0"},
+        {"dayStr": "20200624", "type": "0"},
+        {"dayStr": "20200625", "type": "2"},
+        {"dayStr": "20200626", "type": "2"},
+        {"dayStr": "20200627", "type": "2"},
+        {"dayStr": "20200628", "type": "0"},
+        {"dayStr": "20200629", "type": "0"},
+        {"dayStr": "20200630", "type": "0"},
+        {"dayStr": "20200701", "type": "0"},
+        {"dayStr": "20200702", "type": "0"},
+        {"dayStr": "20200703", "type": "0"},
+        {"dayStr": "20200704", "type": "1"},
+        {"dayStr": "20200705", "type": "1"},
+        {"dayStr": "20200706", "type": "0"},
+        {"dayStr": "20200707", "type": "0"},
+        {"dayStr": "20200708", "type": "0"},
+        {"dayStr": "20200709", "type": "0"},
+        {"dayStr": "20200710", "type": "0"},
+        {"dayStr": "20200711", "type": "1"},
+        {"dayStr": "20200712", "type": "1"},
+        {"dayStr": "20200713", "type": "0"},
+        {"dayStr": "20200714", "type": "0"},
+        {"dayStr": "20200715", "type": "0"},
+        {"dayStr": "20200716", "type": "0"},
+        {"dayStr": "20200717", "type": "0"},
+        {"dayStr": "20200718", "type": "1"},
+        {"dayStr": "20200719", "type": "1"},
+        {"dayStr": "20200720", "type": "0"},
+        {"dayStr": "20200721", "type": "0"},
+        {"dayStr": "20200722", "type": "0"},
+        {"dayStr": "20200723", "type": "0"},
+        {"dayStr": "20200724", "type": "0"},
+        {"dayStr": "20200725", "type": "1"},
+        {"dayStr": "20200726", "type": "1"},
+        {"dayStr": "20200727", "type": "0"},
+        {"dayStr": "20200728", "type": "0"},
+        {"dayStr": "20200729", "type": "0"},
+        {"dayStr": "20200730", "type": "0"},
+        {"dayStr": "20200731", "type": "0"},
+        {"dayStr": "20200801", "type": "1"},
+        {"dayStr": "20200802", "type": "1"},
+        {"dayStr": "20200803", "type": "0"},
+        {"dayStr": "20200804", "type": "0"},
+        {"dayStr": "20200805", "type": "0"},
+        {"dayStr": "20200806", "type": "0"},
+        {"dayStr": "20200807", "type": "0"},
+        {"dayStr": "20200808", "type": "1"},
+        {"dayStr": "20200809", "type": "1"},
+        {"dayStr": "20200810", "type": "0"},
+        {"dayStr": "20200811", "type": "0"},
+        {"dayStr": "20200812", "type": "0"},
+        {"dayStr": "20200813", "type": "0"},
+        {"dayStr": "20200814", "type": "0"},
+        {"dayStr": "20200815", "type": "1"},
+        {"dayStr": "20200816", "type": "1"},
+        {"dayStr": "20200817", "type": "0"},
+        {"dayStr": "20200818", "type": "0"},
+        {"dayStr": "20200819", "type": "0"},
+        {"dayStr": "20200820", "type": "0"},
+        {"dayStr": "20200821", "type": "0"},
+        {"dayStr": "20200822", "type": "1"},
+        {"dayStr": "20200823", "type": "1"},
+        {"dayStr": "20200824", "type": "0"},
+        {"dayStr": "20200825", "type": "0"},
+        {"dayStr": "20200826", "type": "0"},
+        {"dayStr": "20200827", "type": "0"},
+        {"dayStr": "20200828", "type": "0"},
+        {"dayStr": "20200829", "type": "1"},
+        {"dayStr": "20200830", "type": "1"},
+        {"dayStr": "20200831", "type": "0"},
+        {"dayStr": "20200901", "type": "0"},
+        {"dayStr": "20200902", "type": "0"},
+        {"dayStr": "20200903", "type": "0"},
+        {"dayStr": "20200904", "type": "0"},
+        {"dayStr": "20200905", "type": "1"},
+        {"dayStr": "20200906", "type": "1"},
+        {"dayStr": "20200907", "type": "0"},
+        {"dayStr": "20200908", "type": "0"},
+        {"dayStr": "20200909", "type": "0"},
+        {"dayStr": "20200910", "type": "0"},
+        {"dayStr": "20200911", "type": "0"},
+        {"dayStr": "20200912", "type": "1"},
+        {"dayStr": "20200913", "type": "1"},
+        {"dayStr": "20200914", "type": "0"},
+        {"dayStr": "20200915", "type": "0"},
+        {"dayStr": "20200916", "type": "0"},
+        {"dayStr": "20200917", "type": "0"},
+        {"dayStr": "20200918", "type": "0"},
+        {"dayStr": "20200919", "type": "1"},
+        {"dayStr": "20200920", "type": "1"},
+        {"dayStr": "20200921", "type": "0"},
+        {"dayStr": "20200922", "type": "0"},
+        {"dayStr": "20200923", "type": "0"},
+        {"dayStr": "20200924", "type": "0"},
+        {"dayStr": "20200925", "type": "0"},
+        {"dayStr": "20200926", "type": "1"},
+        {"dayStr": "20200927", "type": "0"},
+        {"dayStr": "20200928", "type": "0"},
+        {"dayStr": "20200929", "type": "0"},
+        {"dayStr": "20200930", "type": "0"},
+        {"dayStr": "20201001", "type": "2"},
+        {"dayStr": "20201002", "type": "2"},
+        {"dayStr": "20201003", "type": "2"},
+        {"dayStr": "20201004", "type": "2"},
+        {"dayStr": "20201005", "type": "2"},
+        {"dayStr": "20201006", "type": "2"},
+        {"dayStr": "20201007", "type": "2"},
+        {"dayStr": "20201008", "type": "2"},
+        {"dayStr": "20201009", "type": "0"},
+        {"dayStr": "20201010", "type": "0"},
+        {"dayStr": "20201011", "type": "1"},
+        {"dayStr": "20201012", "type": "0"},
+        {"dayStr": "20201013", "type": "0"},
+        {"dayStr": "20201014", "type": "0"},
+        {"dayStr": "20201015", "type": "0"},
+        {"dayStr": "20201016", "type": "0"},
+        {"dayStr": "20201017", "type": "1"},
+        {"dayStr": "20201018", "type": "1"},
+        {"dayStr": "20201019", "type": "0"},
+        {"dayStr": "20201020", "type": "0"},
+        {"dayStr": "20201021", "type": "0"},
+        {"dayStr": "20201022", "type": "0"},
+        {"dayStr": "20201023", "type": "0"},
+        {"dayStr": "20201024", "type": "1"},
+        {"dayStr": "20201025", "type": "1"},
+        {"dayStr": "20201026", "type": "0"},
+        {"dayStr": "20201027", "type": "0"},
+        {"dayStr": "20201028", "type": "0"},
+        {"dayStr": "20201029", "type": "0"},
+        {"dayStr": "20201030", "type": "0"},
+        {"dayStr": "20201031", "type": "1"},
+        {"dayStr": "20201101", "type": "1"},
+        {"dayStr": "20201102", "type": "0"},
+        {"dayStr": "20201103", "type": "0"},
+        {"dayStr": "20201104", "type": "0"},
+        {"dayStr": "20201105", "type": "0"},
+        {"dayStr": "20201106", "type": "0"},
+        {"dayStr": "20201107", "type": "1"},
+        {"dayStr": "20201108", "type": "1"},
+        {"dayStr": "20201109", "type": "0"},
+        {"dayStr": "20201110", "type": "0"},
+        {"dayStr": "20201111", "type": "0"},
+        {"dayStr": "20201112", "type": "0"},
+        {"dayStr": "20201113", "type": "0"},
+        {"dayStr": "20201114", "type": "1"},
+        {"dayStr": "20201115", "type": "1"},
+        {"dayStr": "20201116", "type": "0"},
+        {"dayStr": "20201117", "type": "0"},
+        {"dayStr": "20201118", "type": "0"},
+        {"dayStr": "20201119", "type": "0"},
+        {"dayStr": "20201120", "type": "0"},
+        {"dayStr": "20201121", "type": "1"},
+        {"dayStr": "20201122", "type": "1"},
+        {"dayStr": "20201123", "type": "0"},
+        {"dayStr": "20201124", "type": "0"},
+        {"dayStr": "20201125", "type": "0"},
+        {"dayStr": "20201126", "type": "0"},
+        {"dayStr": "20201127", "type": "0"},
+        {"dayStr": "20201128", "type": "1"},
+        {"dayStr": "20201129", "type": "1"},
+        {"dayStr": "20201130", "type": "0"},
+        {"dayStr": "20201201", "type": "0"},
+        {"dayStr": "20201202", "type": "0"},
+        {"dayStr": "20201203", "type": "0"},
+        {"dayStr": "20201204", "type": "0"},
+        {"dayStr": "20201205", "type": "1"},
+        {"dayStr": "20201206", "type": "1"},
+        {"dayStr": "20201207", "type": "0"},
+        {"dayStr": "20201208", "type": "0"},
+        {"dayStr": "20201209", "type": "0"},
+        {"dayStr": "20201210", "type": "0"},
+        {"dayStr": "20201211", "type": "0"},
+        {"dayStr": "20201212", "type": "1"},
+        {"dayStr": "20201213", "type": "1"},
+        {"dayStr": "20201214", "type": "0"},
+        {"dayStr": "20201215", "type": "0"},
+        {"dayStr": "20201216", "type": "0"},
+        {"dayStr": "20201217", "type": "0"},
+        {"dayStr": "20201218", "type": "0"},
+        {"dayStr": "20201219", "type": "1"},
+        {"dayStr": "20201220", "type": "1"},
+        {"dayStr": "20201221", "type": "0"},
+        {"dayStr": "20201222", "type": "0"},
+        {"dayStr": "20201223", "type": "0"},
+        {"dayStr": "20201224", "type": "0"},
+        {"dayStr": "20201225", "type": "0"},
+        {"dayStr": "20201226", "type": "1"},
+        {"dayStr": "20201227", "type": "1"},
+        {"dayStr": "20201228", "type": "0"},
+        {"dayStr": "20201229", "type": "0"},
+        {"dayStr": "20201230", "type": "0"},
+        {"dayStr": "20201231", "type": "0"}
+        ]
+
+        srt=[{"dayStr": h, "type": "该不支持日期,只支持2020年"}]
+        for i in day:
+            if i['dayStr']==h:
+                print(i)
+                srt=i
+        print(h)
+
+        return response.json(0,srt)

+ 2 - 0
Controller/EquipmentManager.py

@@ -657,6 +657,8 @@ def deleteInterface(request):
                 # 异步删除推送消息
             asy = threading.Thread(target=ModelService.del_eq_info, args=(userID, uid))
             asy.start()
+            redisObj = RedisObject(db=8)
+            redisObj.del_data(key='uid_qs_' + userID)
         else:
             return response.json(14)
     except Exception as e:

+ 4 - 9
Controller/EquipmentManagerV3.py

@@ -42,8 +42,6 @@ class EquipmentManagerV3(View):
                 return self.do_query(userID, request_dict, response)
             elif operation == 'modify':
                 return self.do_modify(userID, request_dict, response)
-            elif operation == 'query_reset':
-                return self.do_query_reset(userID, request_dict, response)
             else:
                 return response.json(414)
         else:
@@ -96,6 +94,8 @@ class EquipmentManagerV3(View):
                                                  NickName=NickName, View_Account=View_Account,
                                                  View_Password=View_Password, Type=Type, ChannelIndex=ChannelIndex)
                         userDevice.save()
+                        redisObj = RedisObject(db=8)
+                        redisObj.del_data(key='uid_qs_' + userID)
                     except Exception as e:
                         return response.json(10, repr(e))
                     else:
@@ -164,6 +164,8 @@ class EquipmentManagerV3(View):
                     }
                     UidSetModel.objects.create(**uid_set_create_dict)
                 Device_Info.objects.filter(UID=uid).update(NickName=nickname)
+                redisObj = RedisObject(db=8)
+                redisObj.del_data(key='uid_qs_' + userID)
             return response.json(0, res)
     # 新查询设备字段
     def do_query(self, userID, request_dict, response):
@@ -280,13 +282,6 @@ class EquipmentManagerV3(View):
         else:
             return response.json(tko.code)
 
-    # 新查询设备字段
-    def do_query_reset(self, userID, request_dict, response):
-        dvqs = Device_Info.objects.filter(userID_id=userID, isExist=2)
-        dvql = dvqs.values\
-            ('id', 'NickName', 'UID', 'ChannelIndex', 'Type', 'isShare')
-        res = CommonService.qs_to_list(dvql)
-        return response.json(0, res)
 
     # 加密
     def encrypt_pwd(self,userPwd):

+ 4 - 0
Controller/OTAEquipment.py

@@ -489,16 +489,20 @@ def getNewVerInterface(request):
     else:
         equipmentValid = Equipment_Version.objects.filter(code=code, status=1, lang='en').order_by(
             '-data_joined')
+
+    print(equipmentValid)
     if equipmentValid.exists():
         equipment = equipmentValid[0]
         file_path = equipment.filePath
         ver = equipment.softwareVersion
         max_ver = equipment.max_ver
+        print(now_ver <= max_ver)
         if now_ver <= max_ver:
             # 创建url的token
             tko = UrlTokenObject()
             file_path = tko.generate(data={'Url': "ansjer/" + CommonService.RandomStr(6) + "/" + file_path})
             url = SERVER_DOMAIN + 'dlotapack/' + file_path
+            print(url)
             # if SERVER_TYPE == 'Ansjer.formal_settings':
             #     url = SERVER_DOMAIN + 'dlotapack/' + file_path
             # else:

+ 1 - 0
Controller/UserController.py

@@ -50,6 +50,7 @@ class authCodeView(TemplateView):
 
     @method_decorator(csrf_exempt)
     def dispatch(self, *args, **kwargs):
+		# testtest11111111111111
         return super(authCodeView, self).dispatch(*args, **kwargs)
 
     @ratelimit(key='ip', rate='2/m')

+ 8 - 0
Service/MiscellService.py

@@ -365,6 +365,12 @@ def addLog(request, status_code):
                 request_dict = dict(request_dict)
                 request_dict.pop('userPwd')
             content = json.dumps(request_dict)
+            print(content)
+            if user != '':
+                user = user
+            else:
+                print('空')
+                user = '空'
             add_data = {
                 'user': user,
                 'ip': clientIP,
@@ -374,8 +380,10 @@ def addLog(request, status_code):
                 'time': now_time,
                 'content': content
             }
+            print(add_data)
             ModelService.addAccessLog(data=add_data)
     except Exception as e:
+        print(repr(e))
         pass
 
 

+ 2 - 1
Service/TemplateService.py

@@ -53,7 +53,6 @@ class TemplateService:
             'cloudVod/findVod',
             'cloudVod/aliPayCreateOrder',
             'cloudVod/aliPayCallback',
-
             'equipment/add',
             'deviceShare/queryUser',
             'deviceShare/showShareInfo',
@@ -74,6 +73,8 @@ class TemplateService:
             'v3/equipment/modify',
             'v2/account/login',
             'v3/account/login',
+            'detect/queryInfo',
+            'sysmsg/query',
         ]
         return apiList