第一次提交:阿龙电竞 Django 后端最新版本

This commit is contained in:
XingQue
2026-06-14 02:23:24 +08:00
commit 4f7bf00224
9654 changed files with 5417000 additions and 0 deletions

View File

@@ -0,0 +1,339 @@
# -*- coding: utf8 -*-
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# CAM签名/鉴权错误。
AUTHFAILURE = 'AuthFailure'
# 用户无权限访问。
AUTHFAILURE_UNAUTHORIZEDOPERATION = 'AuthFailure.UnauthorizedOperation'
# 为带来更好的服务与体验,长安链体验网络维护升级中,请稍后再试。
FAILEDOPERATION_BAASSTOPSERVING = 'FailedOperation.BaaSStopServing'
# Bcos网络异常。
FAILEDOPERATION_BCOSSERVICE = 'FailedOperation.BcosService'
# 检查CSR文件非法。
FAILEDOPERATION_CACHECKCSR = 'FailedOperation.CaCheckCsr'
# 数据库操作错误。
FAILEDOPERATION_CADBOPTION = 'FailedOperation.CaDbOption'
# 证书已经存在。
FAILEDOPERATION_CAEXSIT = 'FailedOperation.CaExsit'
# 产生密钥对失败。
FAILEDOPERATION_CAGENKEY = 'FailedOperation.CaGenkey'
# 初始化CA失败。
FAILEDOPERATION_CAINIT = 'FailedOperation.CaInit'
# 输入参数非法。
FAILEDOPERATION_CAINPUTPARAM = 'FailedOperation.CaInputParam'
# 证书不存在。
FAILEDOPERATION_CANOEXIST = 'FailedOperation.CaNoExist'
# 注销证书失败。
FAILEDOPERATION_CAREVOKE = 'FailedOperation.CaRevoke'
# 根证书不存在。
FAILEDOPERATION_CAROOTNONEXIST = 'FailedOperation.CaRootNonExist'
# CA内部错误。
FAILEDOPERATION_CASERVICE = 'FailedOperation.CaService'
# 签发证书失败。
FAILEDOPERATION_CASIGNCERT = 'FailedOperation.CaSignCert'
# CFCA云API申请证书失败。
FAILEDOPERATION_CAYUNAPIAPPLYCERT = 'FailedOperation.CaYunApiApplyCert'
# CFCA云API错误。
FAILEDOPERATION_CAYUNAPICOMMON = 'FailedOperation.CaYunApiCommon'
# 合约调用失败
FAILEDOPERATION_CHAINMAKERCHAINCODEINVOKEFAILED = 'FailedOperation.ChainMakerChaincodeInvokeFailed'
# 合约查询失败
FAILEDOPERATION_CHAINMAKERCHAINCODEQUERYFAILED = 'FailedOperation.ChainMakerChaincodeQueryFailed'
# Bcos不能编译已经部署的合约。
FAILEDOPERATION_COMPILEDEPLOYEDCONTRACT = 'FailedOperation.CompileDeployedContract'
# Bcos不能编译正在部署的合约。
FAILEDOPERATION_COMPILEDEPLOYINGCONTRACT = 'FailedOperation.CompileDeployingContract'
# Bcos只能由该合约所属机构执行操作。
FAILEDOPERATION_CONTRACTEDITEDBYOTHERAGENCY = 'FailedOperation.ContractEditedByOtherAgency'
# 数据库操作异常。
FAILEDOPERATION_DATABASEEXCEPTION = 'FailedOperation.DatabaseException'
# Bcos合约已部署无法删除。
FAILEDOPERATION_DELETEDEPLOYEDCONTRACT = 'FailedOperation.DeleteDeployedContract'
# Bcos合约正在部署无法删除。
FAILEDOPERATION_DELETEDEPLOYINGCONTRACT = 'FailedOperation.DeleteDeployingContract'
# Bcos不能部署未编译的合约。
FAILEDOPERATION_DEPLOYCONTRACTNOTCOMPILE = 'FailedOperation.DeployContractNotCompile'
# 区块详情查询失败。
FAILEDOPERATION_FABRICBLOCKDETAIL = 'FailedOperation.FabricBlockDetail'
# 区块不存在。
FAILEDOPERATION_FABRICBLOCKNOEXIST = 'FailedOperation.FabricBlockNoExist'
# 区块列表查询失败。
FAILEDOPERATION_FABRICBLOCKQUERY = 'FailedOperation.FabricBlockQuery'
# 合约调用失败。
FAILEDOPERATION_FABRICCHAINCODEINVOKEFAILED = 'FailedOperation.FabricChaincodeInvokeFailed'
# 合约不存在。
FAILEDOPERATION_FABRICCHAINCODENOEXIST = 'FailedOperation.FabricChaincodeNoExist'
# 合约查询失败。
FAILEDOPERATION_FABRICCHAINCODEQUERYFAILED = 'FailedOperation.FabricChaincodeQueryFailed'
# 提交失败。
FAILEDOPERATION_FABRICCOMMIT = 'FailedOperation.FabricCommit'
# event hub失败。
FAILEDOPERATION_FABRICEVENTHUB = 'FailedOperation.FabricEventHub'
# 背书失败。
FAILEDOPERATION_FABRICPROPOSAL = 'FailedOperation.FabricProposal'
# fabric请求参数错误。
FAILEDOPERATION_FABRICREQUESTPARAMS = 'FailedOperation.FabricRequestParams'
# 参数验证失败。
FAILEDOPERATION_FABRICREQUSTPARAMS = 'FailedOperation.FabricRequstParams'
# 交易详情查询失败。
FAILEDOPERATION_FABRICTRANSACTIONDETAIL = 'FailedOperation.FabricTransactionDetail'
# 交易不存在。
FAILEDOPERATION_FABRICTRANSACTIONNOEXIST = 'FailedOperation.FabricTransactionNoExist'
# 交易列表查询失败。
FAILEDOPERATION_FABRICTRANSACTIONQUERY = 'FailedOperation.FabricTransactionQuery'
# Txid 查询失败。
FAILEDOPERATION_FABRICTXIDQUERY = 'FailedOperation.FabricTxIdQuery'
# fabric invoke交易错误。
FAILEDOPERATION_FABRICTXINVOKE = 'FailedOperation.FabricTxInvoke'
# fabric query交易错误。
FAILEDOPERATION_FABRICTXQUERY = 'FailedOperation.FabricTxQuery'
# fabric query交易错误, 无正确。
FAILEDOPERATION_FABRICTXQUERYNONE = 'FailedOperation.FabricTxQueryNone'
# Bcos前置服务调用失败。
FAILEDOPERATION_FRONTREQUESTFAIL = 'FailedOperation.FrontRequestFail'
# 用户非法操作。
FAILEDOPERATION_GROUPILLEGAL = 'FailedOperation.GroupIllegal'
# 用户无权限访问。
FAILEDOPERATION_INVALIDAUTH = 'FailedOperation.InvalidAuth'
# Bcos无效的群组编号。
FAILEDOPERATION_INVALIDGROUPPK = 'FailedOperation.InvalidGroupPk'
# Bcos无效的私钥用户信息。
FAILEDOPERATION_INVALIDKEYUSER = 'FailedOperation.InvalidKeyUser'
# 用户非法操作。
FAILEDOPERATION_INVALIDOPERATION = 'FailedOperation.InvalidOperation'
# 交易请求异常。
FAILEDOPERATION_MANAGESERVICE = 'FailedOperation.ManageService'
# Bcos新建合约失败。
FAILEDOPERATION_NEWCONTRACT = 'FailedOperation.NewContract'
# 合约没有在通道初始化。
FAILEDOPERATION_NOCHAINCODECHANNEL = 'FailedOperation.NoChainCodeChannel'
# 组织没有加入合约。
FAILEDOPERATION_NOCHAINCODEGROUP = 'FailedOperation.NoChainCodeGroup'
# 合约没有在节点安装。
FAILEDOPERATION_NOCHAINCODEPEER = 'FailedOperation.NoChainCodePeer'
# 组织没有加入通道。
FAILEDOPERATION_NOCHANNELGROUP = 'FailedOperation.NoChannelGroup'
# 节点没有加入通道。
FAILEDOPERATION_NOCHANNELPEER = 'FailedOperation.NoChannelPeer'
# 对象不存在。
FAILEDOPERATION_NOOBJECT = 'FailedOperation.NoObject'
# 没有可用节点。
FAILEDOPERATION_NOPEER = 'FailedOperation.NoPeer'
# Bcos合约未部署。
FAILEDOPERATION_NOTDEPLOYEDCONTRACT = 'FailedOperation.NotDeployedContract'
# 服务调用失败,请检查参数。
FAILEDOPERATION_SERVICEFAILED = 'FailedOperation.ServiceFailed'
# 操作状态不匹配。
FAILEDOPERATION_STATUSNOMATCH = 'FailedOperation.StatusNoMatch'
# 后台服务请求超时。
FAILEDOPERATION_TIMEOUTURL = 'FailedOperation.TimeOutUrl'
# 交易执行超时,请稍后再试。
FAILEDOPERATION_TRANSACTIONTIMEOUT = 'FailedOperation.TransactionTimeout'
# 获取用户认证类型出错。
FAILEDOPERATION_USERAUTHTYPE = 'FailedOperation.UserAuthType'
# 您因违反用户协议,目前无法使用长安链体验网络。
FAILEDOPERATION_USERINBLACKLIST = 'FailedOperation.UserInBlackList'
# 用户未加入体验网络。
FAILEDOPERATION_USERNOJOINDEMOCLUSTER = 'FailedOperation.UserNoJoinDemoCluster'
# Bcos数据库操作异常请重试。
INTERNALERROR_DBERROR = 'InternalError.DBError'
# 服务器异常,请重试。
INTERNALERROR_FAILURL = 'InternalError.FailUrl'
# Flask内部错误。
INTERNALERROR_FLASKEXCEPTION = 'InternalError.FlaskException'
# Bcos无效的合约参数。
INTERNALERROR_INVALIDCONTRACTPARAM = 'InternalError.InvalidContractParam'
# Bcos不支持的请求类型。
INTERNALERROR_METHODTYPENOTSUPPORT = 'InternalError.MethodTypeNotSupport'
# 错误码未定义。
INTERNALERROR_NODEFINEERROR = 'InternalError.NoDefineError'
# 内部错误,请稍后重试或者联系技术人员
INTERNALERROR_SERVERERROR = 'InternalError.ServerError'
# 服务器异常。
INTERNALERROR_SERVEREXCEPTION = 'InternalError.ServerException'
# 服务异常,请重试。
INTERNALERROR_SERVICEERROR = 'InternalError.ServiceError'
# 交易服务异常,请重试。
INTERNALERROR_SERVICEPANIC = 'InternalError.ServicePanic'
# 交易服务内部错误。
INTERNALERROR_TRANSACTIONSERVICE = 'InternalError.TransactionService'
# 交易服务未知错误,请重试。
INTERNALERROR_UNKNOWNERROR = 'InternalError.UnknownError'
# Bcos账号参数错误。
INVALIDPARAMETER_ACCOUNTPARAMERROR = 'InvalidParameter.AccountParamError'
# Bcos无效的机构信息。
INVALIDPARAMETER_AGENCYINVALID = 'InvalidParameter.AgencyInvalid'
# Bcos新增机构网络关联信息入参错误。
INVALIDPARAMETER_AGENCYNETPARAMINVALID = 'InvalidParameter.AgencyNetParamInvalid'
# Bcos所属联盟编号不能为空。
INVALIDPARAMETER_ALLIANCEIDOFNETEMPTY = 'InvalidParameter.AllianceIdOfNetEmpty'
# Bcos无效的合约编号。
INVALIDPARAMETER_CONTRACTIDINVALID = 'InvalidParameter.ContractIdInvalid'
# Bcos数据已存在请勿重复添加。
INVALIDPARAMETER_DATAHADEXIST = 'InvalidParameter.DataHadExist'
# Bcos无效参数。
INVALIDPARAMETER_EMPTYPARAM = 'InvalidParameter.EmptyParam'
# Bcos无效的失效时间。
INVALIDPARAMETER_EXPIRETIMEINVALID = 'InvalidParameter.ExpireTimeInvalid'
# Bcos前置的IP或端口无效。
INVALIDPARAMETER_FRONTCONNFAIL = 'InvalidParameter.FrontConnFail'
# Bcos IP格式错误。
INVALIDPARAMETER_FRONTIPINVALID = 'InvalidParameter.FrontIpInvalid'
# Bcos新增前置服务参数错误。
INVALIDPARAMETER_FRONTPARAMERROR = 'InvalidParameter.FrontParamError'
# Bcos前置服务调用失败。
INVALIDPARAMETER_FRONTREQUESTFAIL = 'InvalidParameter.FrontRequestFail'
# 输入参数存在违规内容。
INVALIDPARAMETER_INPUTDATAVIOLATION = 'InvalidParameter.InputDataViolation'
# Bcos无效的合约参数。
INVALIDPARAMETER_INVALIDCONTRACTARG = 'InvalidParameter.InvalidContractArg'
# Bcos无效的网络编号。
INVALIDPARAMETER_NETIDINVALID = 'InvalidParameter.NetIdInvalid'
# Bcos网络参数错误。
INVALIDPARAMETER_NETPARAMERROR = 'InvalidParameter.NetParamError'
# Bcos新增私钥用户参数错误。
INVALIDPARAMETER_NEWKEYUSERPARAMERROR = 'InvalidParameter.NewKeyUserParamError'
# Bcos无可删信息,请确认后重试。
INVALIDPARAMETER_NOINFOTODELETE = 'InvalidParameter.NoInfoToDelete'
# Bcos没有有效的前置服务信息。
INVALIDPARAMETER_NOTFOUNDVALIDFRONT = 'InvalidParameter.NotFoundValidFront'
# Bcos不能重复部署合约。
INVALIDPARAMETER_REDEPLOYEDCONTRACT = 'InvalidParameter.ReDeployedContract'
# Bcos合约正在部署中请勿重复操作。
INVALIDPARAMETER_REDEPLOYINGCONTRACT = 'InvalidParameter.ReDeployingContract'
# Bcos无效的角色。
INVALIDPARAMETER_ROLEINVALID = 'InvalidParameter.RoleInvalid'
# 参数取值错误。
INVALIDPARAMETERVALUE = 'InvalidParameterValue'
# 参数格式不正确。
INVALIDPARAMETERVALUE_ILLEGALFORMAT = 'InvalidParameterValue.IllegalFormat'
# 请求参数错误。
INVALIDPARAMETERVALUE_ILLEGALVALUE = 'InvalidParameterValue.IllegalValue'
# 参数值为空。
INVALIDPARAMETERVALUE_PARAMETEREMPTY = 'InvalidParameterValue.ParameterEmpty'
# Bcos缺少参数。
MISSINGPARAMETER_EMPTYPARAM = 'MissingParameter.EmptyParam'
# 只有所有者可以操作。
OPERATIONDENIED_NOTOWNER = 'OperationDenied.NotOwner'
# Bcos查询不到数据。
RESOURCENOTFOUND_EMPTYDATA = 'ResourceNotFound.EmptyData'

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,578 @@
# -*- coding: utf8 -*-
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.common.abstract_client import AbstractClient
from tencentcloud.tbaas.v20180416 import models
class TbaasClient(AbstractClient):
_apiVersion = '2018-04-16'
_endpoint = 'tbaas.tencentcloudapi.com'
_service = 'tbaas'
def ApplyChainMakerBatchUserCert(self, request):
r"""批量申请长安链用户签名证书
:param request: Request instance for ApplyChainMakerBatchUserCert.
:type request: :class:`tencentcloud.tbaas.v20180416.models.ApplyChainMakerBatchUserCertRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.ApplyChainMakerBatchUserCertResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("ApplyChainMakerBatchUserCert", params, headers=headers)
response = json.loads(body)
model = models.ApplyChainMakerBatchUserCertResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def ApplyUserCert(self, request):
r"""申请用户证书
:param request: Request instance for ApplyUserCert.
:type request: :class:`tencentcloud.tbaas.v20180416.models.ApplyUserCertRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.ApplyUserCertResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("ApplyUserCert", params, headers=headers)
response = json.loads(body)
model = models.ApplyUserCertResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeFabricBlock(self, request):
r"""获取Fabric某区块的详细信息
:param request: Request instance for DescribeFabricBlock.
:type request: :class:`tencentcloud.tbaas.v20180416.models.DescribeFabricBlockRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.DescribeFabricBlockResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeFabricBlock", params, headers=headers)
response = json.loads(body)
model = models.DescribeFabricBlockResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeFabricTransaction(self, request):
r"""获取Fabric交易的详细信息
:param request: Request instance for DescribeFabricTransaction.
:type request: :class:`tencentcloud.tbaas.v20180416.models.DescribeFabricTransactionRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.DescribeFabricTransactionResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeFabricTransaction", params, headers=headers)
response = json.loads(body)
model = models.DescribeFabricTransactionResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DownloadUserCert(self, request):
r"""下载用户证书
:param request: Request instance for DownloadUserCert.
:type request: :class:`tencentcloud.tbaas.v20180416.models.DownloadUserCertRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.DownloadUserCertResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DownloadUserCert", params, headers=headers)
response = json.loads(body)
model = models.DownloadUserCertResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def GetBlockList(self, request):
r"""查看当前网络下的所有区块列表,分页展示
:param request: Request instance for GetBlockList.
:type request: :class:`tencentcloud.tbaas.v20180416.models.GetBlockListRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.GetBlockListResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("GetBlockList", params, headers=headers)
response = json.loads(body)
model = models.GetBlockListResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def GetBlockTransactionListForUser(self, request):
r"""获取区块内交易列表
:param request: Request instance for GetBlockTransactionListForUser.
:type request: :class:`tencentcloud.tbaas.v20180416.models.GetBlockTransactionListForUserRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.GetBlockTransactionListForUserResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("GetBlockTransactionListForUser", params, headers=headers)
response = json.loads(body)
model = models.GetBlockTransactionListForUserResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def GetClusterSummary(self, request):
r"""获取区块链网络概要
:param request: Request instance for GetClusterSummary.
:type request: :class:`tencentcloud.tbaas.v20180416.models.GetClusterSummaryRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.GetClusterSummaryResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("GetClusterSummary", params, headers=headers)
response = json.loads(body)
model = models.GetClusterSummaryResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def GetInvokeTx(self, request):
r"""Invoke异步调用结果查询
:param request: Request instance for GetInvokeTx.
:type request: :class:`tencentcloud.tbaas.v20180416.models.GetInvokeTxRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.GetInvokeTxResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("GetInvokeTx", params, headers=headers)
response = json.loads(body)
model = models.GetInvokeTxResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def GetLatestTransactionList(self, request):
r"""获取fabric最新交易列表
:param request: Request instance for GetLatestTransactionList.
:type request: :class:`tencentcloud.tbaas.v20180416.models.GetLatestTransactionListRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.GetLatestTransactionListResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("GetLatestTransactionList", params, headers=headers)
response = json.loads(body)
model = models.GetLatestTransactionListResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def GetTransactionDetailForUser(self, request):
r"""获取交易的详情
:param request: Request instance for GetTransactionDetailForUser.
:type request: :class:`tencentcloud.tbaas.v20180416.models.GetTransactionDetailForUserRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.GetTransactionDetailForUserResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("GetTransactionDetailForUser", params, headers=headers)
response = json.loads(body)
model = models.GetTransactionDetailForUserResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def Invoke(self, request):
r"""新增交易
:param request: Request instance for Invoke.
:type request: :class:`tencentcloud.tbaas.v20180416.models.InvokeRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.InvokeResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("Invoke", params, headers=headers)
response = json.loads(body)
model = models.InvokeResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def InvokeChainMakerContract(self, request):
r"""调用长安链合约执行交易
:param request: Request instance for InvokeChainMakerContract.
:type request: :class:`tencentcloud.tbaas.v20180416.models.InvokeChainMakerContractRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.InvokeChainMakerContractResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("InvokeChainMakerContract", params, headers=headers)
response = json.loads(body)
model = models.InvokeChainMakerContractResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def InvokeChainMakerDemoContract(self, request):
r"""调用长安链体验网络合约执行交易
:param request: Request instance for InvokeChainMakerDemoContract.
:type request: :class:`tencentcloud.tbaas.v20180416.models.InvokeChainMakerDemoContractRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.InvokeChainMakerDemoContractResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("InvokeChainMakerDemoContract", params, headers=headers)
response = json.loads(body)
model = models.InvokeChainMakerDemoContractResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def InvokeFabricChaincode(self, request):
r"""调用Fabric用户合约执行交易
:param request: Request instance for InvokeFabricChaincode.
:type request: :class:`tencentcloud.tbaas.v20180416.models.InvokeFabricChaincodeRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.InvokeFabricChaincodeResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("InvokeFabricChaincode", params, headers=headers)
response = json.loads(body)
model = models.InvokeFabricChaincodeResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def Query(self, request):
r"""查询交易
:param request: Request instance for Query.
:type request: :class:`tencentcloud.tbaas.v20180416.models.QueryRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.QueryResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("Query", params, headers=headers)
response = json.loads(body)
model = models.QueryResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def QueryChainMakerBlockTransaction(self, request):
r"""查询长安链指定高度区块的交易
:param request: Request instance for QueryChainMakerBlockTransaction.
:type request: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerBlockTransactionRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerBlockTransactionResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("QueryChainMakerBlockTransaction", params, headers=headers)
response = json.loads(body)
model = models.QueryChainMakerBlockTransactionResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def QueryChainMakerContract(self, request):
r"""调用长安链合约查询
:param request: Request instance for QueryChainMakerContract.
:type request: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerContractRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerContractResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("QueryChainMakerContract", params, headers=headers)
response = json.loads(body)
model = models.QueryChainMakerContractResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def QueryChainMakerDemoBlockTransaction(self, request):
r"""查询长安链体验网络指定高度区块的交易
:param request: Request instance for QueryChainMakerDemoBlockTransaction.
:type request: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerDemoBlockTransactionRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerDemoBlockTransactionResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("QueryChainMakerDemoBlockTransaction", params, headers=headers)
response = json.loads(body)
model = models.QueryChainMakerDemoBlockTransactionResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def QueryChainMakerDemoContract(self, request):
r"""调用长安链体验网络合约查询
:param request: Request instance for QueryChainMakerDemoContract.
:type request: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerDemoContractRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerDemoContractResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("QueryChainMakerDemoContract", params, headers=headers)
response = json.loads(body)
model = models.QueryChainMakerDemoContractResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def QueryChainMakerDemoTransaction(self, request):
r"""通过交易ID查询长安链体验网络交易
:param request: Request instance for QueryChainMakerDemoTransaction.
:type request: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerDemoTransactionRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerDemoTransactionResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("QueryChainMakerDemoTransaction", params, headers=headers)
response = json.loads(body)
model = models.QueryChainMakerDemoTransactionResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def QueryChainMakerTransaction(self, request):
r"""通过交易ID查询长安链交易
:param request: Request instance for QueryChainMakerTransaction.
:type request: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerTransactionRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.QueryChainMakerTransactionResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("QueryChainMakerTransaction", params, headers=headers)
response = json.loads(body)
model = models.QueryChainMakerTransactionResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def QueryFabricChaincode(self, request):
r"""调用Fabric用户合约查询
:param request: Request instance for QueryFabricChaincode.
:type request: :class:`tencentcloud.tbaas.v20180416.models.QueryFabricChaincodeRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.QueryFabricChaincodeResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("QueryFabricChaincode", params, headers=headers)
response = json.loads(body)
model = models.QueryFabricChaincodeResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def SrvInvoke(self, request):
r"""trustsql服务统一接口
:param request: Request instance for SrvInvoke.
:type request: :class:`tencentcloud.tbaas.v20180416.models.SrvInvokeRequest`
:rtype: :class:`tencentcloud.tbaas.v20180416.models.SrvInvokeResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("SrvInvoke", params, headers=headers)
response = json.loads(body)
model = models.SrvInvokeResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))

View File

@@ -0,0 +1,458 @@
# -*- coding: utf8 -*-
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from tencentcloud.common.abstract_client_async import AbstractClient
from tencentcloud.tbaas.v20180416 import models
from typing import Dict
class TbaasClient(AbstractClient):
_apiVersion = '2018-04-16'
_endpoint = 'tbaas.tencentcloudapi.com'
_service = 'tbaas'
async def ApplyChainMakerBatchUserCert(
self,
request: models.ApplyChainMakerBatchUserCertRequest,
opts: Dict = None,
) -> models.ApplyChainMakerBatchUserCertResponse:
"""
批量申请长安链用户签名证书
"""
kwargs = {}
kwargs["action"] = "ApplyChainMakerBatchUserCert"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.ApplyChainMakerBatchUserCertResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def ApplyUserCert(
self,
request: models.ApplyUserCertRequest,
opts: Dict = None,
) -> models.ApplyUserCertResponse:
"""
申请用户证书
"""
kwargs = {}
kwargs["action"] = "ApplyUserCert"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.ApplyUserCertResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def DescribeFabricBlock(
self,
request: models.DescribeFabricBlockRequest,
opts: Dict = None,
) -> models.DescribeFabricBlockResponse:
"""
获取Fabric某区块的详细信息
"""
kwargs = {}
kwargs["action"] = "DescribeFabricBlock"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.DescribeFabricBlockResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def DescribeFabricTransaction(
self,
request: models.DescribeFabricTransactionRequest,
opts: Dict = None,
) -> models.DescribeFabricTransactionResponse:
"""
获取Fabric交易的详细信息
"""
kwargs = {}
kwargs["action"] = "DescribeFabricTransaction"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.DescribeFabricTransactionResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def DownloadUserCert(
self,
request: models.DownloadUserCertRequest,
opts: Dict = None,
) -> models.DownloadUserCertResponse:
"""
下载用户证书
"""
kwargs = {}
kwargs["action"] = "DownloadUserCert"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.DownloadUserCertResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def GetBlockList(
self,
request: models.GetBlockListRequest,
opts: Dict = None,
) -> models.GetBlockListResponse:
"""
查看当前网络下的所有区块列表,分页展示
"""
kwargs = {}
kwargs["action"] = "GetBlockList"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.GetBlockListResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def GetBlockTransactionListForUser(
self,
request: models.GetBlockTransactionListForUserRequest,
opts: Dict = None,
) -> models.GetBlockTransactionListForUserResponse:
"""
获取区块内交易列表
"""
kwargs = {}
kwargs["action"] = "GetBlockTransactionListForUser"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.GetBlockTransactionListForUserResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def GetClusterSummary(
self,
request: models.GetClusterSummaryRequest,
opts: Dict = None,
) -> models.GetClusterSummaryResponse:
"""
获取区块链网络概要
"""
kwargs = {}
kwargs["action"] = "GetClusterSummary"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.GetClusterSummaryResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def GetInvokeTx(
self,
request: models.GetInvokeTxRequest,
opts: Dict = None,
) -> models.GetInvokeTxResponse:
"""
Invoke异步调用结果查询
"""
kwargs = {}
kwargs["action"] = "GetInvokeTx"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.GetInvokeTxResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def GetLatestTransactionList(
self,
request: models.GetLatestTransactionListRequest,
opts: Dict = None,
) -> models.GetLatestTransactionListResponse:
"""
获取fabric最新交易列表
"""
kwargs = {}
kwargs["action"] = "GetLatestTransactionList"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.GetLatestTransactionListResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def GetTransactionDetailForUser(
self,
request: models.GetTransactionDetailForUserRequest,
opts: Dict = None,
) -> models.GetTransactionDetailForUserResponse:
"""
获取交易的详情
"""
kwargs = {}
kwargs["action"] = "GetTransactionDetailForUser"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.GetTransactionDetailForUserResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def Invoke(
self,
request: models.InvokeRequest,
opts: Dict = None,
) -> models.InvokeResponse:
"""
新增交易
"""
kwargs = {}
kwargs["action"] = "Invoke"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.InvokeResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def InvokeChainMakerContract(
self,
request: models.InvokeChainMakerContractRequest,
opts: Dict = None,
) -> models.InvokeChainMakerContractResponse:
"""
调用长安链合约执行交易
"""
kwargs = {}
kwargs["action"] = "InvokeChainMakerContract"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.InvokeChainMakerContractResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def InvokeChainMakerDemoContract(
self,
request: models.InvokeChainMakerDemoContractRequest,
opts: Dict = None,
) -> models.InvokeChainMakerDemoContractResponse:
"""
调用长安链体验网络合约执行交易
"""
kwargs = {}
kwargs["action"] = "InvokeChainMakerDemoContract"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.InvokeChainMakerDemoContractResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def InvokeFabricChaincode(
self,
request: models.InvokeFabricChaincodeRequest,
opts: Dict = None,
) -> models.InvokeFabricChaincodeResponse:
"""
调用Fabric用户合约执行交易
"""
kwargs = {}
kwargs["action"] = "InvokeFabricChaincode"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.InvokeFabricChaincodeResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def Query(
self,
request: models.QueryRequest,
opts: Dict = None,
) -> models.QueryResponse:
"""
查询交易
"""
kwargs = {}
kwargs["action"] = "Query"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.QueryResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def QueryChainMakerBlockTransaction(
self,
request: models.QueryChainMakerBlockTransactionRequest,
opts: Dict = None,
) -> models.QueryChainMakerBlockTransactionResponse:
"""
查询长安链指定高度区块的交易
"""
kwargs = {}
kwargs["action"] = "QueryChainMakerBlockTransaction"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.QueryChainMakerBlockTransactionResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def QueryChainMakerContract(
self,
request: models.QueryChainMakerContractRequest,
opts: Dict = None,
) -> models.QueryChainMakerContractResponse:
"""
调用长安链合约查询
"""
kwargs = {}
kwargs["action"] = "QueryChainMakerContract"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.QueryChainMakerContractResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def QueryChainMakerDemoBlockTransaction(
self,
request: models.QueryChainMakerDemoBlockTransactionRequest,
opts: Dict = None,
) -> models.QueryChainMakerDemoBlockTransactionResponse:
"""
查询长安链体验网络指定高度区块的交易
"""
kwargs = {}
kwargs["action"] = "QueryChainMakerDemoBlockTransaction"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.QueryChainMakerDemoBlockTransactionResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def QueryChainMakerDemoContract(
self,
request: models.QueryChainMakerDemoContractRequest,
opts: Dict = None,
) -> models.QueryChainMakerDemoContractResponse:
"""
调用长安链体验网络合约查询
"""
kwargs = {}
kwargs["action"] = "QueryChainMakerDemoContract"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.QueryChainMakerDemoContractResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def QueryChainMakerDemoTransaction(
self,
request: models.QueryChainMakerDemoTransactionRequest,
opts: Dict = None,
) -> models.QueryChainMakerDemoTransactionResponse:
"""
通过交易ID查询长安链体验网络交易
"""
kwargs = {}
kwargs["action"] = "QueryChainMakerDemoTransaction"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.QueryChainMakerDemoTransactionResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def QueryChainMakerTransaction(
self,
request: models.QueryChainMakerTransactionRequest,
opts: Dict = None,
) -> models.QueryChainMakerTransactionResponse:
"""
通过交易ID查询长安链交易
"""
kwargs = {}
kwargs["action"] = "QueryChainMakerTransaction"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.QueryChainMakerTransactionResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def QueryFabricChaincode(
self,
request: models.QueryFabricChaincodeRequest,
opts: Dict = None,
) -> models.QueryFabricChaincodeResponse:
"""
调用Fabric用户合约查询
"""
kwargs = {}
kwargs["action"] = "QueryFabricChaincode"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.QueryFabricChaincodeResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def SrvInvoke(
self,
request: models.SrvInvokeRequest,
opts: Dict = None,
) -> models.SrvInvokeResponse:
"""
trustsql服务统一接口
"""
kwargs = {}
kwargs["action"] = "SrvInvoke"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.SrvInvokeResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)