Commit ffc8e536 authored by shiyu's avatar shiyu

微信音频内容安全识别回调

parent 271226ec
package com.wwdz.ch.wx.api;
import com.wwdz.ch.core.api.QdOfficialAccountApi;
import com.wwdz.ch.core.consts.OfficalAccountEnum;
import com.wwdz.ch.db.dao.qiandao.QdUserDao;
import com.wwdz.ch.db.domain.qiandao.QdOfficialAccountSubscribeRecord;
import com.wwdz.ch.db.domain.qiandao.QdUser;
import com.wwdz.ch.wx.api.aes.AesException;
import com.wwdz.ch.wx.api.aes.WXBizMsgCrypt;
import com.wwdz.ch.wx.service.qiandao.QdOfficialAccountSubscribeRecordService;
import com.xxdxxs.utils.StringUtils;
import com.xxdxxs.utils.XmlUtils;
import org.dom4j.DocumentException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/QdAppletCallback")
public class QdAppletCallbackController {
private static final Logger logger = LoggerFactory.getLogger(QdAppletCallbackController.class);
@Value("${dts.qdwx.app-id}")
private String APPID;
@Value("${dts.qdwx.app-secret}")
private String APPSECRET;
@Autowired
QdOfficialAccountApi qdOfficialAccountApi;
@Autowired
QdOfficialAccountSubscribeRecordService qdOfficialAccountSubscribeRecordService;
@Autowired
QdUserDao qdUserDao;
@RequestMapping(value ="/getNotice")
public Object getNotice(@RequestParam(required = false, name = "signature") String signature,
@RequestParam(required = false, name = "timestamp") String timestamp,
@RequestParam(required = false, name = "nonce") String nonce,
@RequestParam(required = false, name = "echostr") String echostr,
HttpServletRequest request, HttpServletResponse response){
logger.info("接收小程序推送信息校验 -> appid: {}, signature:{}, timestamp:{}, nonce:{}, echostr : {}", APPID, signature, timestamp, nonce, echostr);
if (StringUtils.hasLength(echostr)) {
return Long.valueOf(echostr.trim());
}
return "success";
}
}
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