消息的接收与回复:
文本消息 图文消息 音乐消息 图片消息 地理位置消息 链接消息 音频消息 事件推送respContent = "欢迎关注 "+logo+" ! 我们会竭力为您提供更多精彩的内容!" + "\n\n回复 1 , 2 , 3 ,... 查看更多的内容!";
Article article = new Article(); article.setTitle("艳辉——推荐蜗蜗"); article.setDescription("我做微商的原则是:" + "①有产品,自己先用,用得好,和小伙伴们分享" + "②不推销,我每天发圈,只是想告诉小伙伴们我一直在做" + "③不夸大,东西有多好,咨询我,我会告诉你"); article.setPicUrl("https://upload.cc/i/rmYMvH.jpg"); article.setUrl("https://user.qzone.qq.com/934247746"); articleList.add(article);
Music music = new Music(); music.setTitle("我爱他"); music.setDescription("我爱他-丁当"); music.setMusicUrl("http://dl.loveq.cn/program/2017/LoveQ.cn_2017-12-17-1.mp3"); music.setHQMusicUrl("http://dl.loveq.cn/program/2017/LoveQ.cn_2017-12-17-1.mp3");
// 取得图片地址 String picUrl = requestMap.get("PicUrl"); // 人脸检测 String detectResult = FaceService.detect(picUrl); textMessage.setContent(detectResult); return MessageUtil.messageToXml(textMessage);
// 用户发送的经纬度 String lng = requestMap.get("Location_Y"); String lat = requestMap.get("Location_X"); // 坐标转换后的经纬度 String bd09Lng = null; String bd09Lat = null; // 调用接口转换坐标 UserLocation userLocation = BaiduMapUtil.convertCoord(lng, lat); if (null != userLocation) { bd09Lng = userLocation.getBd09Lng(); bd09Lat = userLocation.getBd09Lat(); } // logger.info("lng= " + lng + "; lat= " + lat); // logger.info("bd09Lng= " + bd09Lng + "; bd09Lat= " + bd09Lat); // 保存用户地理位置 // int count = userLocationDao.saveUserLocation(fromUserName, lng, lat, bd09Lng, bd09Lat); com.yanhui.weixin.pojo.UserLocation userLocation2 = new com.yanhui.weixin.pojo.UserLocation(null,fromUserName, lng, lat, bd09Lng, bd09Lat); int count = userLocationMapper.insert(userLocation2);
respContent = "您发送的是链接消息!";
respContent = "您发送的是音频消息!";
respContent = "您发送的是事件推送!"; --用拦截器实现用户关注获取用户信息,返回关注语言文字,和取消关注。