Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加ci内容审核相关的接口。 #173

Merged
merged 3 commits into from
Sep 16, 2021

Conversation

degangliu
Copy link
Contributor

增加ci内容审核相关的接口。

@@ -91,6 +92,7 @@ def __init__(self, Appid=None, Region=None, SecretId=None, SecretKey=None, Token
if (Scheme != u'http' and Scheme != u'https'):
raise CosClientError('Scheme can be only set to http/https')
self._scheme = Scheme
self._endpoint_ci = format_endpoint(Endpoint, Region, u'ci.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_endpoint_ci 为什么赋值了两次

@@ -4371,6 +4373,447 @@ def ci_get_object_qrcode(self, Bucket, Key, Cover, **kwargs):
data = xml_to_dict(rt.content)
return response, data

def ci_auditing_submit_common(self, Bucket, Key, DetectType, Type, Url=None, BizType=None, Conf={}, Input=None, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci函数也补充到UT中吧,不然后面被人改坏了也不知道,发版本前都会跑UT的

@@ -39,7 +39,7 @@ class CosConfig(object):
def __init__(self, Appid=None, Region=None, SecretId=None, SecretKey=None, Token=None, Scheme=None, Timeout=None,
Access_id=None, Access_key=None, Secret_id=None, Secret_key=None, Endpoint=None, IP=None, Port=None,
Anonymous=None, UA=None, Proxies=None, Domain=None, ServiceDomain=None, PoolConnections=10,
PoolMaxSize=10, AllowRedirects=False, SignHost=True):
PoolMaxSize=10, AllowRedirects=False, SignHost=True, EndpointCi=None):
"""初始化,保存用户的信息

:param Appid(string): 用户APPID.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加EndpointCi的注释说明

@zhy1985555 zhy1985555 merged commit a336377 into tencentyun:master Sep 16, 2021
if Key:
Input['Object'] = Key
if Content:
Input['Content'] = base64.b64encode(Content)
Copy link

@tssujt tssujt Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhy1985555 @degangliu 这里 Input['Content'] 的类型为 bytes,那么之后在 ci_auditing_submit_common 中调用 format_xml 的话会得到类似于如下的结果

<?xml version="1.0" encoding="UTF-8"?>
<Request>
   <Input>
      <Content>
         <Content>53</Content>
         <Content>76</Content>
         <Content>105</Content>
         <Content>116</Content>
         <Content>53</Content>
         <Content>54</Content>
         <Content>101</Content>
         <Content>76</Content>
         <Content>54</Content>
         <Content>73</Content>
         <Content>113</Content>
         <Content>67</Content>
         <Content>53</Content>
         <Content>98</Content>
         <Content>43</Content>
         <Content>114</Content>
         <Content>53</Content>
         <Content>76</Content>
         <Content>109</Content>
         <Content>81</Content>
      </Content>
   </Input>
   <Conf>
      <DetectType>Porn,Terrorism,Politics,Ads</DetectType>
   </Conf>
</Request>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python3确实有问题 非常感谢 我修复一下

degangliu added a commit to degangliu/cos-python-sdk-v5 that referenced this pull request Sep 29, 2021
增加ci内容审核相关的接口。 (tencentyun#173)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants