Package com.foxinmy.weixin4j.wxa.api
Class SecCheckApi
- java.lang.Object
-
- com.foxinmy.weixin4j.api.BaseApi
-
- com.foxinmy.weixin4j.wxa.api.SecCheckApi
-
public class SecCheckApi extends BaseApi
违法违规内容检查。- Since:
- 1.9
-
-
Field Summary
-
Fields inherited from class com.foxinmy.weixin4j.api.BaseApi
weixinExecutor
-
-
Constructor Summary
Constructors Constructor Description SecCheckApi(TokenManager tokenManager)
SecCheckApi(TokenManager tokenManager, Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getRequestUri(String key)
void
imgSecCheck(InputStream inputStream)
校验一张图片是否含有违法违规内容。void
imgSecCheck(InputStream inputStream, int maxWidth, int maxHeight)
String
mediaCheckAsync(String mediaUrl, int mediaType)
异步校验图片/音频是否含有违法违规内容。void
msgSecCheck(String content)
检查一段文本是否含有违法违规内容。protected ResourceBundle
weixinBundle()
-
-
-
Constructor Detail
-
SecCheckApi
public SecCheckApi(TokenManager tokenManager)
-
SecCheckApi
public SecCheckApi(TokenManager tokenManager, Properties properties)
-
-
Method Detail
-
imgSecCheck
public void imgSecCheck(InputStream inputStream) throws WeixinException
校验一张图片是否含有违法违规内容。- Parameters:
inputStream
- the image input stream.- Throws:
WeixinException
- indicates getting access token failed, or the content is risky.- See Also:
- 校验一张图片是否含有违法违规内容
-
imgSecCheck
public void imgSecCheck(InputStream inputStream, int maxWidth, int maxHeight) throws WeixinException
- Throws:
WeixinException
-
msgSecCheck
public void msgSecCheck(String content) throws WeixinException
检查一段文本是否含有违法违规内容。- Parameters:
content
- 要检测的文本内容,长度不超过 500KB,编码格式为 UTF-8。- Throws:
WeixinException
- indicates getting access token failed, or the content is risky.- See Also:
- 检查一段文本是否含有违法违规内容
-
mediaCheckAsync
public String mediaCheckAsync(String mediaUrl, int mediaType) throws WeixinException
异步校验图片/音频是否含有违法违规内容。- Parameters:
mediaUrl
- 要检测的多媒体 URLmediaType
-1
: 音频;2
: 图片- Returns:
- 任务 ID,用于匹配异步推送结果
- Throws:
WeixinException
- indicates getting access token failed.- See Also:
- security.mediaCheckAsync
-
weixinBundle
protected ResourceBundle weixinBundle()
- Specified by:
weixinBundle
in classBaseApi
-
getRequestUri
protected String getRequestUri(String key)
- Overrides:
getRequestUri
in classBaseApi
-
-