Commit 08abc82f authored by shiyu's avatar shiyu

1

parent 37d1cf30
......@@ -27,6 +27,9 @@ public class WxAppletApi {
@Autowired
WxLoginManager wxLoginManager;
/* @Autowired
ItemShortUrlServer itemShortUrlServer;*/
// 微信小程序音视频内容安全识别地址
private static final String MEDIA_CHECK_URL = "https://api.weixin.qq.com/wxa/media_check_async?access_token=%s";
......@@ -47,4 +50,26 @@ public class WxAppletApi {
logger.info("[checkMedia] response :{}", responseStr);
return responseStr;
}
public String getUrlLink(WxCheckMediaRequestDto dto) {
String accessToken = wxLoginManager.getAccessToken();
String url = String.format(MEDIA_CHECK_URL, accessToken);
OkHttpUtil okHttpUtil = OkHttpUtil.builder().url(url);
Map<String, Object> map = new HashMap<>();
map.put("media_url", dto.getMediaUrl());
map.put("media_type", dto.getMediaType());
map.put("version", 2);
map.put("scene", 4);
map.put("openid", dto.getWxOpenId());
okHttpUtil.addParams(map);
okHttpUtil.post(true);
String responseStr = okHttpUtil.async();
logger.info("[checkMedia] response :{}", responseStr);
return responseStr;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment