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 com.foxinmy.weixin4j.api.BaseApi
违法违规内容检查。- Since:
- 1.9
-
-
Constructor Summary
Constructors Constructor Description SecCheckApi(com.foxinmy.weixin4j.token.TokenManager tokenManager)
SecCheckApi(com.foxinmy.weixin4j.token.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(com.foxinmy.weixin4j.token.TokenManager tokenManager)
-
SecCheckApi
public SecCheckApi(com.foxinmy.weixin4j.token.TokenManager tokenManager, Properties properties)
-
-
Method Detail
-
imgSecCheck
public void imgSecCheck(InputStream inputStream) throws com.foxinmy.weixin4j.exception.WeixinException
校验一张图片是否含有违法违规内容。- Parameters:
inputStream
- the image input stream.- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- indicates getting access token failed, or the content is risky.- See Also:
- 校验一张图片是否含有违法违规内容
-
imgSecCheck
public void imgSecCheck(InputStream inputStream, int maxWidth, int maxHeight) throws com.foxinmy.weixin4j.exception.WeixinException
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
-
msgSecCheck
public void msgSecCheck(String content) throws com.foxinmy.weixin4j.exception.WeixinException
检查一段文本是否含有违法违规内容。- Parameters:
content
- 要检测的文本内容,长度不超过 500KB,编码格式为 UTF-8。- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- indicates getting access token failed, or the content is risky.- See Also:
- 检查一段文本是否含有违法违规内容
-
mediaCheckAsync
public String mediaCheckAsync(String mediaUrl, int mediaType) throws com.foxinmy.weixin4j.exception.WeixinException
异步校验图片/音频是否含有违法违规内容。- Parameters:
mediaUrl
- 要检测的多媒体 URLmediaType
-1
: 音频;2
: 图片- Returns:
- 任务 ID,用于匹配异步推送结果
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- indicates getting access token failed.- See Also:
- security.mediaCheckAsync
-
weixinBundle
protected ResourceBundle weixinBundle()
- Specified by:
weixinBundle
in classcom.foxinmy.weixin4j.api.BaseApi
-
-