Przeglądaj źródła

删除cloudVod/storeplaylist接口

locky 2 lat temu
rodzic
commit
da43686ec8
1 zmienionych plików z 1 dodań i 51 usunięć
  1. 1 51
      Controller/CloudVod.py

+ 1 - 51
Controller/CloudVod.py

@@ -1,4 +1,3 @@
-import datetime
 import json
 import math
 import time
@@ -15,8 +14,7 @@ from django.views.decorators.csrf import csrf_exempt
 from django.views.generic.base import View
 
 from Ansjer.config import OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET, OSS_ROLE_ARN, SERVER_DOMAIN, PAYPAL_CRD
-from Model.models import Device_Info, Order_Model, Store_Meal, VodHlsModel, OssCrdModel, UID_Bucket, StsCrdModel, \
-    VodHlsSummary
+from Model.models import Device_Info, Order_Model, Store_Meal, VodHlsModel, OssCrdModel, UID_Bucket, StsCrdModel
 from Object.AliPayObject import AliPayObject
 from Object.ResponseObject import ResponseObject
 from Object.TokenObject import TokenObject
@@ -43,7 +41,6 @@ class CloudVodView(View):
 
     def validation(self, request_dict, request, operation):
         response = ResponseObject()
-        # operation => cloudVod/path
         if operation is None:
             return response.json(444, 'error path')
         if operation == 'getSts':
@@ -53,8 +50,6 @@ class CloudVodView(View):
         # 付款完成
         elif operation == 'payExecute':
             return self.do_paypal_execute(request_dict, response)
-        elif operation == 'storeplaylist':
-            return self.do_store_palylist(request_dict, response)
         elif operation == 'payOK':
             return self.do_pay_ok()
         elif operation == 'payError':
@@ -485,51 +480,6 @@ class CloudVodView(View):
             format(uidToken=utko.token, SERVER_DOMAIN=SERVER_DOMAIN)
         return response.json(0, {'uidTkUrl': uidTkUrl, 'storeHlsUrl': storeHlsUrl})
 
-    def do_store_palylist(self, request_dict, response):
-        uidToken = request_dict.get('uidToken', None)
-        storeTime = request_dict.get('time', None)
-        sec = request_dict.get('sec', None)
-        utko = UidTokenObject(uidToken)
-        if utko.flag is False:
-            return response.json(444, 'uidToken')
-        if not uidToken or not storeTime or not sec:
-            return response.json(444, 'uidToken,time,sec')
-        sec = int(sec)
-        UID = utko.UID
-        channel = utko.channel
-        print(channel)
-        print(UID)
-        nowTime = int(time.time())
-        if not OssCrdModel.objects.filter(uid=UID, channel=channel).exists():
-            res = {'code': 404, 'msg': '设备未购买'}
-            return HttpResponse(json.dumps(res, ensure_ascii=False), content_type="application/json,charset=utf-8")
-        qs = UID_Bucket.objects.filter(uid=UID, channel=channel, status=1, endTime__gte=nowTime). \
-            values("channel", "bucket__storeDay", "bucket_id")
-        if not qs.exists():
-            res = {'code': 404, 'msg': '设备未购买'}
-            return HttpResponse(json.dumps(res, ensure_ascii=False), content_type="application/json,charset=utf-8")
-        storeDay = qs[0]['bucket__storeDay']
-        bucketID = qs[0]['bucket_id']
-        endTime = int(storeTime) + storeDay * 86400
-        VodHlsModel.objects.create(uid=UID, channel=channel, time=storeTime,
-                                   endTime=endTime, bucket_id=bucketID, sec=sec)
-
-        end_time_stamp = datetime.datetime.fromtimestamp(int(storeTime))
-        end_time_str = datetime.datetime(end_time_stamp.year, end_time_stamp.month, 1)
-        end_time_stamp = CommonService.str_to_timestamp(end_time_str.strftime('%Y-%m-%d %H:%M:%S'))
-        vod_hls_qs = VodHlsSummary.objects.filter(uid=UID, time=end_time_stamp)
-        if vod_hls_qs.exists():
-            vod_hls = vod_hls_qs.first()
-            vod_hls.upload_frequency += 1
-            vod_hls.upload_duration += sec
-            vod_hls.updated_time = nowTime
-            vod_hls.save()
-        else:
-            VodHlsSummary.objects.create(uid=UID, time=end_time_stamp, created_time=nowTime, updated_time=nowTime,
-                                         upload_duration=sec, upload_frequency=1)
-
-        return response.json(0)
-
     def do_filter_playlist(self, request_dict, userID, response):
         startTime = int(request_dict.get('startTime', None))
         endTime = int(request_dict.get('endTime', None))