Package org.hamster.weixinmp.dao.entity.base

Examples of org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity


  }

  @RequestMapping(method = RequestMethod.POST)
  public @ResponseBody
  String post(@RequestBody String requestBody) throws DocumentException, WxException {
    WxBaseMsgEntity msg = messageService.parseXML(requestBody);
    log.info("received " + msg.getMsgType() + " message.");
   
    WxBaseRespEntity resp = messageService.handleMessage(msg);
   
    return messageService.parseRespXML(resp).asXML();
  }
View Full Code Here


    //////////////////////////////////////////////////

  @SuppressWarnings("unchecked")
  private static <T> T msgEntityFactory(
      Class<? extends WxBaseMsgEntity> clazz, Element ele) {
    WxBaseMsgEntity result;
    try {
      result = clazz.newInstance();
      result.setToUserName(strVal(ele, "ToUserName"));
      result.setFromUserName(strVal(ele, "FromUserName"));
      result.setCreateTime(longVal(ele, "CreateTime"));
      result.setCreatedDate(new Date());
      result.setMsgType(strVal(ele, "MsgType"));
      if (ele.element("MsgId") != null) {
        result.setMsgId(longVal(ele, "MsgId"));
      }
      return (T) result;
    } catch (Exception e) {
      // never occurs
      return null;
View Full Code Here

TOP

Related Classes of org.hamster.weixinmp.dao.entity.base.WxBaseMsgEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.