//事件 else if(msgType.equals(MessageUtil.REQ_MESSAGE_TYPE_EVENT)){ //事件類型 String eventType=requestMap.get("Event"); //關(guān)注事件 if(eventType.equals(MessageUtil.EVENT_TYPE_SUBSCRIBE)){ tm.setContent("歡迎關(guān)注電計(jì)學(xué)院作品展示平臺(tái)!"); } else if(eventType.equals(MessageUtil.EVENT_TYPE_UNSUBSCRIBE)){ } //菜單點(diǎn)擊事件 else if(eventType.equals(MessageUtil.EVENT_TYPE_CLICK)){ //Key String EventKey=requestMap.get("EventKey"); } //單圖文消息(無圖) else if(eventType.equals(MessageUtil.EVENT_TYPE_CLICK)){ //Key String EventKey=requestMap.get("EventKey"); if(EventKey.equals("KEY_11")){ Article article = new Article(); article.setTitle("作品演示視頻"); article.setDescription("以下是歷屆電計(jì)學(xué)生的優(yōu)秀作品演示視頻"); article.setPicUrl(""); article.setUrl("http://www.baidu.com"); List<Article>articleList = new ArrayList<Article>(); articleList.add(article); NewsMessage newsMessage = new NewsMessage(); newsMessage.setFromUserName(toUserName); newsMessage.setToUserName(fromUserName); newsMessage.setCreateTime(new Date().getTime()); newsMessage.setMsgType(MessageUtil.RESP_MESSAGE_TYPE_NEWS); newsMessage.setArticleCount(articleList.size()); newsMessage.setArticles(articleList); respXML = MessageUtil.messageToXML(newsMessage); } }
這樣寫有什么不對(duì)么,不報(bào)錯(cuò),但是微信那邊沒有響應(yīng)
慕工程6005648
2017-06-01 16:20:45