package com.panzhihua.applets.weixin;
|
|
import javax.annotation.Resource;
|
|
import org.springframework.stereotype.Service;
|
|
import com.panzhihua.applets.config.WxMaConfiguration;
|
|
import cn.binarywang.wx.miniapp.api.WxMaSecCheckService;
|
import lombok.extern.slf4j.Slf4j;
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
/**
|
* @program: springcloud_k8s_panzhihuazhihuishequ
|
* @description: 微信内容审查
|
* @author: huang.hongfa weixin hhf9596 qq 959656820
|
* @create: 2021-02-25 10:57
|
**/
|
@Slf4j
|
@Service
|
public class CheckService {
|
@Resource
|
private WxMaConfiguration wxMaConfiguration;
|
|
public boolean checkMessage(String msg) {
|
WxMaSecCheckService wxMaSecCheckService = wxMaConfiguration.getMaService("").getSecCheckService();
|
try {
|
boolean b = wxMaSecCheckService.checkMessage(msg);
|
return b;
|
} catch (WxErrorException e) {
|
log.error("微信审核文字内容出错【{}】", e.getMessage());
|
e.printStackTrace();
|
}
|
return false;
|
}
|
}
|