第一次提交:阿龙电竞 Django 后端最新版本
This commit is contained in:
@@ -0,0 +1,164 @@
|
||||
# -*- 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.cms.v20190321 import models
|
||||
|
||||
|
||||
class CmsClient(AbstractClient):
|
||||
_apiVersion = '2019-03-21'
|
||||
_endpoint = 'cms.tencentcloudapi.com'
|
||||
_service = 'cms'
|
||||
|
||||
|
||||
def CreateKeywordsSamples(self, request):
|
||||
r"""创建关键词接口
|
||||
|
||||
:param request: Request instance for CreateKeywordsSamples.
|
||||
:type request: :class:`tencentcloud.cms.v20190321.models.CreateKeywordsSamplesRequest`
|
||||
:rtype: :class:`tencentcloud.cms.v20190321.models.CreateKeywordsSamplesResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreateKeywordsSamples", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreateKeywordsSamplesResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeleteLibSamples(self, request):
|
||||
r"""删除关键词接口
|
||||
|
||||
:param request: Request instance for DeleteLibSamples.
|
||||
:type request: :class:`tencentcloud.cms.v20190321.models.DeleteLibSamplesRequest`
|
||||
:rtype: :class:`tencentcloud.cms.v20190321.models.DeleteLibSamplesResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeleteLibSamples", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeleteLibSamplesResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeKeywordsLibs(self, request):
|
||||
r"""获取用户词库列表
|
||||
|
||||
:param request: Request instance for DescribeKeywordsLibs.
|
||||
:type request: :class:`tencentcloud.cms.v20190321.models.DescribeKeywordsLibsRequest`
|
||||
:rtype: :class:`tencentcloud.cms.v20190321.models.DescribeKeywordsLibsResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeKeywordsLibs", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeKeywordsLibsResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DescribeLibSamples(self, request):
|
||||
r"""获取关键词接口
|
||||
|
||||
:param request: Request instance for DescribeLibSamples.
|
||||
:type request: :class:`tencentcloud.cms.v20190321.models.DescribeLibSamplesRequest`
|
||||
:rtype: :class:`tencentcloud.cms.v20190321.models.DescribeLibSamplesResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DescribeLibSamples", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DescribeLibSamplesResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def ImageModeration(self, request):
|
||||
r"""图片内容检测服务(Image Moderation, IM)能自动扫描图片,识别涉黄、涉恐、涉政、涉毒等有害内容,同时支持用户配置图片黑名单,打击自定义的违规图片。
|
||||
|
||||
:param request: Request instance for ImageModeration.
|
||||
:type request: :class:`tencentcloud.cms.v20190321.models.ImageModerationRequest`
|
||||
:rtype: :class:`tencentcloud.cms.v20190321.models.ImageModerationResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("ImageModeration", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.ImageModerationResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def TextModeration(self, request):
|
||||
r"""文本内容检测(Text Moderation)服务使用了深度学习技术,识别涉黄、涉政、涉恐等有害内容,同时支持用户配置词库,打击自定义的违规文本。
|
||||
|
||||
:param request: Request instance for TextModeration.
|
||||
:type request: :class:`tencentcloud.cms.v20190321.models.TextModerationRequest`
|
||||
:rtype: :class:`tencentcloud.cms.v20190321.models.TextModerationResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("TextModeration", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.TextModerationResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
@@ -0,0 +1,134 @@
|
||||
# -*- 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.cms.v20190321 import models
|
||||
from typing import Dict
|
||||
|
||||
|
||||
class CmsClient(AbstractClient):
|
||||
_apiVersion = '2019-03-21'
|
||||
_endpoint = 'cms.tencentcloudapi.com'
|
||||
_service = 'cms'
|
||||
|
||||
async def CreateKeywordsSamples(
|
||||
self,
|
||||
request: models.CreateKeywordsSamplesRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreateKeywordsSamplesResponse:
|
||||
"""
|
||||
创建关键词接口
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreateKeywordsSamples"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreateKeywordsSamplesResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeleteLibSamples(
|
||||
self,
|
||||
request: models.DeleteLibSamplesRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeleteLibSamplesResponse:
|
||||
"""
|
||||
删除关键词接口
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeleteLibSamples"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeleteLibSamplesResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeKeywordsLibs(
|
||||
self,
|
||||
request: models.DescribeKeywordsLibsRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeKeywordsLibsResponse:
|
||||
"""
|
||||
获取用户词库列表
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeKeywordsLibs"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeKeywordsLibsResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DescribeLibSamples(
|
||||
self,
|
||||
request: models.DescribeLibSamplesRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DescribeLibSamplesResponse:
|
||||
"""
|
||||
获取关键词接口
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DescribeLibSamples"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DescribeLibSamplesResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def ImageModeration(
|
||||
self,
|
||||
request: models.ImageModerationRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.ImageModerationResponse:
|
||||
"""
|
||||
图片内容检测服务(Image Moderation, IM)能自动扫描图片,识别涉黄、涉恐、涉政、涉毒等有害内容,同时支持用户配置图片黑名单,打击自定义的违规图片。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "ImageModeration"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.ImageModerationResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def TextModeration(
|
||||
self,
|
||||
request: models.TextModerationRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.TextModerationResponse:
|
||||
"""
|
||||
文本内容检测(Text Moderation)服务使用了深度学习技术,识别涉黄、涉政、涉恐等有害内容,同时支持用户配置词库,打击自定义的违规文本。
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "TextModeration"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.TextModerationResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
@@ -0,0 +1,132 @@
|
||||
# -*- 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'
|
||||
|
||||
# 操作失败。
|
||||
FAILEDOPERATION = 'FailedOperation'
|
||||
|
||||
# 内部错误
|
||||
INTERNALERROR = 'InternalError'
|
||||
|
||||
# 服务内部错误。
|
||||
INTERNALERROR_INTERNALERROR = 'InternalError.InternalError'
|
||||
|
||||
# 参数错误。
|
||||
INVALIDPARAMETER = 'InvalidParameter'
|
||||
|
||||
# 图片长宽比太大
|
||||
INVALIDPARAMETER_IMAGEASPECTRATIOTOOLARGE = 'InvalidParameter.ImageAspectRatioTooLarge'
|
||||
|
||||
# 图片体积太小
|
||||
INVALIDPARAMETER_IMAGEDATATOOSMALL = 'InvalidParameter.ImageDataTooSmall'
|
||||
|
||||
# 图片尺寸过小。
|
||||
INVALIDPARAMETER_IMAGESIZETOOSMALL = 'InvalidParameter.ImageSizeTooSmall'
|
||||
|
||||
# 图片内容错误。
|
||||
INVALIDPARAMETER_INVALIDIMAGECONTENT = 'InvalidParameter.InvalidImageContent'
|
||||
|
||||
# 参数不可用
|
||||
INVALIDPARAMETER_PARAMETERERROR = 'InvalidParameter.ParameterError'
|
||||
|
||||
# FileContent不可用:需Base64编码
|
||||
INVALIDPARAMETERVALUE_ERRFILECONTENT = 'InvalidParameterValue.ErrFileContent'
|
||||
|
||||
# 图片尺寸错误。
|
||||
INVALIDPARAMETERVALUE_ERRIMAGESIZE = 'InvalidParameterValue.ErrImageSize'
|
||||
|
||||
# 文本内容过长。
|
||||
INVALIDPARAMETERVALUE_ERRTEXTCONTENTLEN = 'InvalidParameterValue.ErrTextContentLen'
|
||||
|
||||
# 文本内容类型错误:需base64编码
|
||||
INVALIDPARAMETERVALUE_ERRTEXTCONTENTTYPE = 'InvalidParameterValue.ErrTextContentType'
|
||||
|
||||
# Content参数错误
|
||||
INVALIDPARAMETERVALUE_INVALIDCONTENT = 'InvalidParameterValue.InvalidContent'
|
||||
|
||||
# 图片文件内容大小异常。
|
||||
INVALIDPARAMETERVALUE_INVALIDFILECONTENTSIZE = 'InvalidParameterValue.InvalidFileContentSize'
|
||||
|
||||
# 图片内容错误
|
||||
INVALIDPARAMETERVALUE_INVALIDIMAGECONTENT = 'InvalidParameterValue.InvalidImageContent'
|
||||
|
||||
# 参数取值错误
|
||||
INVALIDPARAMETERVALUE_INVALIDPARAMETER = 'InvalidParameterValue.InvalidParameter'
|
||||
|
||||
# 超过配额限制。
|
||||
LIMITEXCEEDED = 'LimitExceeded'
|
||||
|
||||
# 缺少参数错误。
|
||||
MISSINGPARAMETER = 'MissingParameter'
|
||||
|
||||
# FileUrl或FileContent都为空
|
||||
MISSINGPARAMETER_ERRFILEURL = 'MissingParameter.ErrFileUrl'
|
||||
|
||||
# 操作被拒绝。
|
||||
OPERATIONDENIED = 'OperationDenied'
|
||||
|
||||
# 请求的次数超过了频率限制。
|
||||
REQUESTLIMITEXCEEDED = 'RequestLimitExceeded'
|
||||
|
||||
# 资源被占用。
|
||||
RESOURCEINUSE = 'ResourceInUse'
|
||||
|
||||
# 资源不足。
|
||||
RESOURCEINSUFFICIENT = 'ResourceInsufficient'
|
||||
|
||||
# 资源不存在。
|
||||
RESOURCENOTFOUND = 'ResourceNotFound'
|
||||
|
||||
# 文件链接下载内部错误
|
||||
RESOURCENOTFOUND_ERRDOWDOWNINTERNALERROR = 'ResourceNotFound.ErrDowdownInternalError'
|
||||
|
||||
# 文件链接下载服务参数异常
|
||||
RESOURCENOTFOUND_ERRDOWDOWNPARAMSERROR = 'ResourceNotFound.ErrDowdownParamsError'
|
||||
|
||||
# 文件链接下载源错误
|
||||
RESOURCENOTFOUND_ERRDOWDOWNSOURCEERROR = 'ResourceNotFound.ErrDowdownSourceError'
|
||||
|
||||
# 文件链接下载超时
|
||||
RESOURCENOTFOUND_ERRDOWDOWNTIMEOUT = 'ResourceNotFound.ErrDowdownTimeOut'
|
||||
|
||||
# 资源不可用。
|
||||
RESOURCEUNAVAILABLE = 'ResourceUnavailable'
|
||||
|
||||
# 图片识别服务超时
|
||||
RESOURCEUNAVAILABLE_ERRIMAGETIMEOUT = 'ResourceUnavailable.ErrImageTimeOut'
|
||||
|
||||
# 文本识别服务超时
|
||||
RESOURCEUNAVAILABLE_ERRTEXTTIMEOUT = 'ResourceUnavailable.ErrTextTimeOut'
|
||||
|
||||
# 图片文件下载失败。
|
||||
RESOURCEUNAVAILABLE_IMAGEDOWNLOADERROR = 'ResourceUnavailable.ImageDownloadError'
|
||||
|
||||
# 未授权操作。
|
||||
UNAUTHORIZEDOPERATION = 'UnauthorizedOperation'
|
||||
|
||||
# 鉴权失败
|
||||
UNAUTHORIZEDOPERATION_ERRAUTH = 'UnauthorizedOperation.ErrAuth'
|
||||
|
||||
# 未开通权限/无有效套餐包/账号已欠费。
|
||||
UNAUTHORIZEDOPERATION_UNAUTHORIZED = 'UnauthorizedOperation.Unauthorized'
|
||||
|
||||
# 未知参数错误。
|
||||
UNKNOWNPARAMETER = 'UnknownParameter'
|
||||
|
||||
# 操作不支持。
|
||||
UNSUPPORTEDOPERATION = 'UnsupportedOperation'
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user