6 changed files with 102 additions and 43 deletions
@ -0,0 +1,52 @@ |
|||
package com.elink.esua.epdc.async; |
|||
|
|||
import cn.binarywang.wx.miniapp.api.WxMaSecCheckService; |
|||
import cn.binarywang.wx.miniapp.api.WxMaService; |
|||
import me.chanjar.weixin.common.error.WxErrorException; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.scheduling.annotation.Async; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.io.File; |
|||
|
|||
/** |
|||
* 微信内容安全检查 |
|||
* @Author LC |
|||
* @Date 2019/9/18 9:58 |
|||
*/ |
|||
@Component |
|||
public class WxMaSecCheckTask { |
|||
|
|||
@Autowired |
|||
private WxMaService wxMaService; |
|||
|
|||
/** |
|||
* 微信上传文本安全检查 |
|||
* @Params: [message] |
|||
* @Return: void |
|||
* @Author: liuchuang |
|||
* @Date: 2019/9/18 10:17 |
|||
*/ |
|||
@Async |
|||
public void checkMessage(String message) { |
|||
WxMaSecCheckService wxMaSecCheckService = wxMaService.getSecCheckService(); |
|||
wxMaSecCheckService.checkMessage(message); |
|||
} |
|||
|
|||
/** |
|||
* 微信上传图片安全检查 |
|||
* @Params: [file] |
|||
* @Return: void |
|||
* @Author: liuchuang |
|||
* @Date: 2019/9/18 14:57 |
|||
*/ |
|||
@Async |
|||
public void checkImage(File file) { |
|||
WxMaSecCheckService wxMaSecCheckService = wxMaService.getSecCheckService(); |
|||
try { |
|||
wxMaSecCheckService.checkImage(file); |
|||
} catch (WxErrorException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue