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fJZet/S8tlHG4UyP2R5qUw6JRPwQvqgfxSSk7JKF1//2Q==", "FileName": "test.png" } ] return upload_document_files(files, file_type='png') def upload_document_files(files, file_type='png'): _files = files file_ids = [] # 腾讯电子签接口限制 20 张图片 while len(_files) > 0: res = upload_files(_files[:20], file_type=file_type, business_type='DOCUMENT') print(res) file_ids = file_ids + res.FileIds _files = _files[20:] return file_ids def upload_files(files, file_type='png', business_type='DOCUMENT'): # https://qian.tencent.com/developers/companyApis/templatesAndFiles/UploadFiles/ try: # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密 # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305 # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取 cred = credential.Credential(secret_id, secret_key) # 实例化一个http选项,可选的,没有特殊需求可以跳过 httpProfile = HttpProfile() httpProfile.endpoint = file_endpoint # 实例化一个client选项,可选的,没有特殊需求可以跳过 clientProfile = ClientProfile() clientProfile.httpProfile = httpProfile # 实例化要请求产品的client对象,clientProfile是可选的 client = ess_client.EssClient(cred, "", clientProfile) # 实例化一个请求对象,每个接口都会对应一个request对象 req = models.UploadFilesRequest() params = { "FileType": file_type, "Caller": { "OperatorId": operator_id }, "FileInfos": files, "BusinessType": business_type } req.from_json_string(json.dumps(params)) # 返回的resp是一个DescribeFlowTemplatesResponse的实例,与请求对象对应 resp = client.UploadFiles(req) # 输出json格式的字符串回包 # print(resp.to_json_string()) except TencentCloudSDKException as err: print(err) resp = {} return resp def test_create_flow(): class lensman: phone = '18888888888' identity_card_name = '张三' identity_card_number = '460005199605144313' FlowName = lensman.identity_card_name + "的投稿合同" + tc.local_string(format='%Y%m%d') FlowType = '活动投稿授权书' Approvers = [{ "ApproverType": 1, "Required": True, "NotifyType": None, "ApproverMobile": lensman.phone, "ApproverName": lensman.identity_card_name, "ApproverIdCardType": "ID_CARD", "ApproverIdCardNumber": lensman.identity_card_number, }] return create_flow(flow_name=FlowName, flow_type=FlowType, approvers=Approvers) def create_flow(flow_name=None, flow_type=None, approvers=None): # https://qian.tencent.com/developers/companyApis/startFlows/CreateFlow try: # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密 # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305 # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取 cred = credential.Credential(secret_id, secret_key) # 实例化一个http选项,可选的,没有特殊需求可以跳过 httpProfile = HttpProfile() httpProfile.endpoint = endpoint # 实例化一个client选项,可选的,没有特殊需求可以跳过 clientProfile = ClientProfile() clientProfile.httpProfile = httpProfile # 实例化要请求产品的client对象,clientProfile是可选的 client = ess_client.EssClient(cred, "", clientProfile) # 实例化一个请求对象,每个接口都会对应一个request对象 req = models.CreateFlowRequest() params = { "Operator": { "UserId": operator_id }, "FlowName": flow_name, "FlowType": flow_type, "Approvers": approvers, } req.from_json_string(json.dumps(params)) # 返回的resp是一个DescribeFlowTemplatesResponse的实例,与请求对象对应 resp = client.CreateFlow(req) # 输出json格式的字符串回包 # print(resp.to_json_string()) except TencentCloudSDKException as err: print(err) resp = {} return resp def test_create_document(): class lensman: phone = '18888888888' identity_card_name = '张三' identity_card_number = '460005199605144313' flow_id = 'yDCHHUU08ki1zsUY6XuiSQfzpNaT4BXE' file_id = 'yDCHHUU08q2s90UGmXutvE1Vf4nBGGYu' form_fields = [ { "ComponentId": "ComponentId_0", "ComponentValue": lensman.identity_card_name }, { "ComponentId": "ComponentId_1", "ComponentValue": lensman.identity_card_number, }, { "ComponentId": "ComponentId_2", "ComponentValue": "100", }, { "ComponentId": "ComponentId_3", "ComponentValue": "壹佰", }, { "ComponentId": "ComponentId_37", "ComponentValue": file_id, } ] return create_document(flow_id=flow_id, form_fields=form_fields) def create_document(flow_id=None, form_fields=None): # https://qian.tencent.com/developers/companyApis/startFlows/CreateDocument/ try: # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密 # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305 # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取 cred = credential.Credential(secret_id, secret_key) # 实例化一个http选项,可选的,没有特殊需求可以跳过 httpProfile = HttpProfile() httpProfile.endpoint = endpoint # 实例化一个client选项,可选的,没有特殊需求可以跳过 clientProfile = ClientProfile() clientProfile.httpProfile = httpProfile # 实例化要请求产品的client对象,clientProfile是可选的 client = ess_client.EssClient(cred, "", clientProfile) # 实例化一个请求对象,每个接口都会对应一个request对象 req = models.CreateDocumentRequest() params = { "Operator": { "UserId": operator_id }, "TemplateId": template_id, "FlowId": flow_id, "FormFields": form_fields, } req.from_json_string(json.dumps(params)) # 返回的resp是一个DescribeFlowTemplatesResponse的实例,与请求对象对应 resp = client.CreateDocument(req) # 输出json格式的字符串回包 # print(resp.to_json_string()) except TencentCloudSDKException as err: print(err) resp = {} return resp def test_start_flow(): flow_id = 'yDCHHUU08ki1zsUY6XuiSQfzpNaT4BXE' return start_flow(flow_id=flow_id) def start_flow(flow_id=None): # https://qian.tencent.com/developers/companyApis/startFlows/StartFlow/ try: # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密 # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305 # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取 cred = credential.Credential(secret_id, secret_key) # 实例化一个http选项,可选的,没有特殊需求可以跳过 httpProfile = HttpProfile() httpProfile.endpoint = endpoint # 实例化一个client选项,可选的,没有特殊需求可以跳过 clientProfile = ClientProfile() clientProfile.httpProfile = httpProfile # 实例化要请求产品的client对象,clientProfile是可选的 client = ess_client.EssClient(cred, "", clientProfile) # 实例化一个请求对象,每个接口都会对应一个request对象 req = models.StartFlowRequest() params = { "Operator": { "UserId": operator_id }, "FlowId": flow_id, } req.from_json_string(json.dumps(params)) # 返回的resp是一个DescribeFlowTemplatesResponse的实例,与请求对象对应 resp = client.StartFlow(req) # 输出json格式的字符串回包 # print(resp.to_json_string()) except TencentCloudSDKException as err: print(err) resp = {} return resp def test_create_scheme_url(): class lensman: phone = '18888888888' identity_card_name = '张三' identity_card_number = '460005199605144313' flow_id = 'yDCHHUU08ki1zsUY6XuiSQfzpNaT4BXE' return create_scheme_url(flow_id=flow_id, name=lensman.identity_card_name, mobile=lensman.phone, card_type='ID_CARD', card_number=lensman.identity_card_number) def create_scheme_url(flow_id=None, name=None, mobile=None, card_type='ID_CARD', card_number=None): # https://qian.tencent.com/developers/companyApis/startFlows/CreateSchemeUrl try: # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密 # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305 # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取 cred = credential.Credential(secret_id, secret_key) # 实例化一个http选项,可选的,没有特殊需求可以跳过 httpProfile = HttpProfile() httpProfile.endpoint = endpoint # 实例化一个client选项,可选的,没有特殊需求可以跳过 clientProfile = ClientProfile() clientProfile.httpProfile = httpProfile # 实例化要请求产品的client对象,clientProfile是可选的 client = ess_client.EssClient(cred, "", clientProfile) # 实例化一个请求对象,每个接口都会对应一个request对象 req = models.CreateSchemeUrlRequest() params = { "Operator": { "UserId": operator_id }, "FlowId": flow_id, "Name": name, "Mobile": mobile, "IdCardType": card_type, "IdCardNumber": card_number, "EndPoint": "APP", "PathType": 1, # 腾讯电子签小程序流程合同的详情页 "AutoJumpBack": True, # 签署完成会自动跳转回来 } req.from_json_string(json.dumps(params)) # 返回的resp是一个DescribeFlowTemplatesResponse的实例,与请求对象对应 resp = client.CreateSchemeUrl(req) # 输出json格式的字符串回包 # print(resp.to_json_string()) except TencentCloudSDKException as err: print(err) resp = {} return resp def decode_aes256(data, encryption_key): iv = encryption_key[0:16] aes = AES.new(encryption_key, AES.MODE_CBC, iv) d = aes.decrypt(data) unpad = lambda s: s[0:-ord(d[-1:])] return unpad(d) def test_decode(): # https://qian.tencent.com/developers/company/callback_types_v2 data = "62KE4r5Wz0yHzEpMOwVRbM1KV0pPjj+cmJkT+i65MMscgfHAdNP+9K0nV/fFw1xriwi08APc/wM0mHprE43Hc91VPhRDnu2Wn0+bjzgjmy/FgZKZATR9oquy0/BCWu4C77AjkpkoU1/E7gGLr8M9u9t7zbS4AkkGK5xL5TtwI0sS+CMygmyV7bRjxebMycI52U3QJiwDRIPxFO+7yqeXYXV9AQrRskpCDBNFGW72bh+Ixw9dtX00kWcwVQ93V+mayrvdQ8oGSsL32m72kbBfahsIvIxSYSdDAEeTyokqKGfaLWD27vm55QG218IFKEsOJFDGdqCF+IBcM/+rOFeOrewvP5ehIO2KjFBecTDn0RQTlIiokXIQ4zJKvu6njePFRFoFCZjd4oiEIVn/OBw+rjXml3qwgVBQjPRtYdvDJFNENlVjlkVVmLWeS8MIdqsFWhm6Sa7O8X57mwc0cLJ22mGbyVEzNTFqeFJ/mkueW0leLcoZdjv/+IxZusqa1cpfwzkZhwi5rY6kJffNkkrxIc6OeRvpU4ECgBe/b+kxX+ObC0z9u7nzoZAOHx4akYviyIU5B1romjdfHQ/wDr5udm4Rl4NBhU/6V06Rvaadw0Ta9oBkZHGNxFWv32MnL7fVA0zVNOFDP8n+kaQiNGFAXLF4F5oIItYc5+Gp/IxfkltEki7ni7LztViE7b/ZiKSM+gzQn6fLsJ/dlUoZmh141Y0V/GPpsbxBOnWCjBZdNkLTKxdKCMScLCTysJxv7l6Swff8nAEurbzx1tvyhJAvUDnIaLyP8pRPRFq8p0xm3ZVpOo9k7A952XxVHSs40g4sr/Dihkn60aVhGtKK9DueCzn8P3cWG4TYc03M1hNlPfF+UAfnvQ1ZYAMKT/XPLqYtgRFpRkK96YfVecIrfUe9MjWl0/g4hYCAAOJurFoeGwkJiyQ8Q7DCI5EaHa3s/vI621yQyytC6D2u86RiDJxMW0PdvkUfayT7iPwC83EsfEzpQXr0yeSCQCSBgNByEuCNnZl8LAhYl05Y9+bgCzSPt6EUvmaXclYL+/EPrEmi+hzIdXUwBfhXgICT8MteJgMSgmJM2FjjGxy6uZtfHKRIzf1wk6OORPkPJtMgjlMtMs6VFC62EEeo5Xy2v1S95WT/WQ0tnGR8KjbNnmjNSRyD8VtS2mjlLXaK0xRb71YGt57O19YxQQ3R/Hq9zGqOjG+Agdl+pcvh47RlF8o3CnlU7Q==" encryption_key = 'TencentEssEncryptTestKey12345678' return callback_decode(data, encryption_key) def callback_decode(data, encryption_key=None): # 此处传入密文,如果接收到的数据是{"encrypt":"base64后的密文"} # data = 'base64后的密文' data = base64.b64decode(data) encryption_key = encryption_key or callback_secret_key # encryption_key = bytes(encryption_key or callback_secret_key, encoding="utf8") # 此处传入CallbackUrlKey e = decode_aes256(data, encryption_key) # print(type(e)) # print(e) # print(str(e, encoding="utf8")) return json.loads(e) def test_describe_file_urls(): # { # "TotalCount": 1, # "FileUrls": [ # { # "Url": "https://file.ess.tencent.cn/file/FLOW/yDCHQUU0q7lli4UxZZqK9EJQBXolGmKl/0/0.PDF?hkey=2224d95a960e5bc7e6e3686cff314349ca93867dbd0b1eca01ba63991c8bd8e9c479977410d668b7b3d5bf14af059f969ce4644cf43a7cb6395601a042cadd33a56be20d1643070aa660af450d0ee0b6e30758030e2c0cbd2276bd1d4f05c818", # "Option": "[\"595.30,841.90\",\"-1\"]" # } # ], # "RequestId": "e9381020-c673-4ea6-b051-3a64b0e8a821" # } business_id = 'yDCHQUU0q7lli4UxZZqK9EJQBXolGmKl' return describe_file_urls(business_id=business_id) def describe_file_urls(business_type='FLOW', business_id=None, business_ids=None, file_type='PDF', url_ttl=86400): # https://qian.tencent.com/developers/companyApis/templatesAndFiles/DescribeFileUrls/ try: # 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密 # 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305 # 密钥可前往官网控制台 https://console.cloud.tencent.com/cam/capi 进行获取 cred = credential.Credential(secret_id, secret_key) # 实例化一个http选项,可选的,没有特殊需求可以跳过 httpProfile = HttpProfile() httpProfile.endpoint = endpoint # 实例化一个client选项,可选的,没有特殊需求可以跳过 clientProfile = ClientProfile() clientProfile.httpProfile = httpProfile # 实例化要请求产品的client对象,clientProfile是可选的 client = ess_client.EssClient(cred, "", clientProfile) # 实例化一个请求对象,每个接口都会对应一个request对象 req = models.DescribeFileUrlsRequest() business_ids = business_ids or [business_id] params = { "Operator": { "UserId": operator_id }, "BusinessType": business_type, "BusinessIds": business_ids, "FileType": file_type, "UrlTtl": url_ttl, } req.from_json_string(json.dumps(params)) # 返回的resp是一个DescribeFlowTemplatesResponse的实例,与请求对象对应 resp = client.DescribeFileUrls(req) # 输出json格式的字符串回包 # print(resp.to_json_string()) except TencentCloudSDKException as err: print(err) resp = {} return resp kodo - Gogs: Go Git Service

暫無描述

index.html 1.7KB

    <!doctype html> <html> <head> <meta charset="UTF-8"> <title>拍爱 PAI.AI 首页</title> <meta name="keywords" content="摄影 图片 影像 分享 交流 社交 交友 摄影师 女性 孩子 亲子 旅行 旅游 约拍 iphone android app" /> <link href="css/layout.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="js/jquery.min.js"></script> </head> <body class="content_bg"> <div id="header"> <div class="content"> <a href="index.html" target="_self" class="logo"></a> <div class="navigation"> <a href="contactus.html" target="_self" >联系我们</a> <a href="joinus.html" target="_self" >加入拍爱</a> <a href="aboutus.html" target="_self" >关于我们</a> <a href="index.html" target="_self" class="current" >首页</a> </div> </div> </div> <div id="container" > <div class="content"> <div class="container_box"> <div class="mobile"></div> <div class="mb_img"></div> <div class="article"><span>即拍即分享</span><p>一起走过的路,<br>一起看过的美景,<br>一起醉过的Party,......<br>回忆容易消逝,<br>一起拍,照片让爱历久弥新。</p></div> <a href="https://itunes.apple.com/cn/app/pai-aipaiai/id1163960351?mt=8" target="_blank" class="ios_download">iPhone下载</a> <a href="" target="_blank" class="android_download">安卓下载</a> </div> </div> </div> <div id="footer"> <div class="content foot homefooter"> <a href="aboutus.html" target="_self" >关于我们</a> <span>|</span> <a href="contactus.html" target="_self" >联系我们</a> ©2016 拍爱 PAI.AI 琼ICP备16000076号 </div> </div> </body> </html>