605
+CONTRACT_LENSMAN_CONTRIBUTION_OPERATOR_ID = 'yDCp3UU055m70lUx6jaTk1RVkiVkKenJ'
595 606
 CONTRACT_LENSMAN_CONTRIBUTION_TEMPLATE_ID = 'yDCp3UU05rgksnUXtZsEvdrK1tRGb7ax'
596
-CONTRACT_LENSMAN_CONTRIBUTION_OPERATOR_ID = 'yDCp3UU055m70lUx6jaTk1RVkiVkKenJ'
607
+CONTRACT_LENSMAN_CONTRIBUTION_SECRET_ID = 'AKIDAHh3WzlYvHqOoR69MI94329FIGEDA62x'
608
+CONTRACT_LENSMAN_CONTRIBUTION_SECRET_KEY = 'tieio5Rn7PqARmJzcAcAh4gNE3rowEc3'
609
+CONTRACT_LENSMAN_CONTRIBUTION_CALLBACK_SECRET_ID = 'F0C875BC8B9442AE8E4769155F812EC0'
610
+CONTRACT_LENSMAN_CONTRIBUTION_CALLBACK_SECRET_KEY = '645CD7B0067B4FCEB6A9A6D589EC9DD6'

+ 27 - 0
utils/tencentcloud/ess.py

@@ -0,0 +1,291 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+import json
4
+
5
+from django.conf import settings
6
+from tencentcloud.common import credential
7
+from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
8
+from tencentcloud.common.profile.client_profile import ClientProfile
9
+from tencentcloud.common.profile.http_profile import HttpProfile
10
+from tencentcloud.ess.v20201111 import ess_client, models
11
+from TimeConvert import TimeConvert as tc
12
+
13
+
14
+tencentcloud_cfg = settings.TENCENTCLOUD.get('ess', {})
15
+operator_id = tencentcloud_cfg.get('operator_id')
16
+template_id = tencentcloud_cfg.get('template_id')
17
+secret_id = tencentcloud_cfg.get('secret_id')
18
+secret_key = tencentcloud_cfg.get('secret_key')
19
+callback_secret_id = tencentcloud_cfg.get('callback_secret_id')
20
+callback_secret_key = tencentcloud_cfg.get('callback_secret_key')
21
+endpoint = tencentcloud_cfg.get('endpoint')
22
+file_endpoint = tencentcloud_cfg.get('file_endpoint')
23
+
24
+
25
+def test_upload_document_files(files, file_type='png'):
26
+    files = [
27
+        {

kodo - Gogs: Go Git Service

説明なし

rbrief.py 712B

    # -*- coding: utf-8 -*- from isoweek import Week from TimeConvert import TimeConvert as tc from utils.redis.connect import r from utils.redis.rkeys import TODAY_INCOME, TOTAL_INCOME, WEEK_INCOME, WEEK_SOLD def set_brief_info(uid, ptype, fee, dt=None): """ 更新简报信息 """ ymd, week = (tc.local_string(tc.to_local_datetime(dt), format='%Y%m%d'), Week.withdate(dt)) if dt else (tc.local_string(format='%Y%m%d'), Week.thisweek().isoformat()) # 总收入 r.incr(TOTAL_INCOME % (uid, ptype), fee) # 周收入 r.incr(WEEK_INCOME % (uid, ptype, week), fee) # 日收入 r.incr(TODAY_INCOME % (uid, ptype, ymd), fee) # 周售出 r.incr(WEEK_SOLD % (uid, ptype, week))