예제 #1
0
  public static String testScanHasSubEventReqMsg() {
    ScanNotSubEventReqMsg scanEventMsg = new ScanNotSubEventReqMsg();

    scanEventMsg.setFromUserName("Fan_Jasic");
    scanEventMsg.setToUserName("LemonTree");
    scanEventMsg.setMsgId(11111);
    scanEventMsg.setEvent(Event.subscribe);
    scanEventMsg.setEventKey("qrscene_120");
    scanEventMsg.setTicket("Ticket");
    scanEventMsg.setCreateTime(System.currentTimeMillis() / 1000);

    String reqBody = MessageUtil.scanEventMessageToXml(scanEventMsg);
    return reqBody;
  }
예제 #2
0
  public static String testTextMessage() {
    TextReqMsg textReqMsg = new TextReqMsg();

    textReqMsg.setFromUserName("gh_b817172873c4");
    textReqMsg.setToUserName("LemonTree");
    textReqMsg.setContent("Test Content测试内容");
    textReqMsg.setMsgType(MessageUtil.REQ_MESSAGE_TYPE_TEXT);
    textReqMsg.setMsgId(1);
    textReqMsg.setCreateTime(System.currentTimeMillis() / 1000);

    String reqBody = MessageUtil.textMessageToXml(textReqMsg);
    System.out.println(reqBody);
    return reqBody;
  }