123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #!/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: 2020/2/27 9:38
- @Version: python3.6
- @MODIFY DECORD:ansjer dev
- @file: AppSetController.py
- @Contact: chanjunkai@163.com
- """
- from django.views.generic.base import View
- from Object.ResponseObject import ResponseObject
- class AppSetView(View):
- def get(self, request, *args, **kwargs):
- request.encoding = 'utf-8'
- operation = kwargs.get('operation', None)
- return self.validation(request.GET, operation)
- def post(self, request, *args, **kwargs):
- request.encoding = 'utf-8'
- operation = kwargs.get('operation', None)
- return self.validation(request.POST, operation)
- def validation(self, request_dict, operation):
- response = ResponseObject()
- # token = request_dict.get('token', None)
- # tko = TokenObject(token)
- # userID = tko.userID
- if operation == 'query':
- return self.do_query(request_dict, response)
- else:
- return response.json(414)
- def do_query(self, request_dict, response):
- appBundleId = request_dict.get('appBundleId', None)
- if not appBundleId:
- return response.json(444,'appBundleId')
- res = {}
- res['grade'] = 1
- # # 用户帮助
- res['usingHelp'] = 0
- # # AP添加方式
- res['apAdd'] = 1
- # # AP工具
- res['apTool'] = 1
- # # 广告模块
- res['ad_module'] = {
- "time": 0,
- "ad_path": [
- "https://test.dvema.com/web/static/image/default_ad1",
- "https://test.dvema.com/web/static/image/default_ad2",
- "https://test.dvema.com/web/static/image/default_ad3",
- ]
- }
- res['init_img'] = 'https://test.dvema.com/web/static/image/default_start'
- return response.json(0, res)
|