@Test @Disabled void testSendText() { dingTalkService.sendText("wx: hello", "15062227589"); }
@Override public void sendText(String textMessage, String... atMobiles) { log.info("Sending text: {} {}", textMessage, atMobiles); OapiRobotSendRequest request = new OapiRobotSendRequest(); request.setMsgtype("text"); OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text(); text.setContent(textMessage); request.setText(text); if (atMobiles.length != 0) { OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); at.setAtMobiles(Arrays.asList(atMobiles)); request.setAt(at); } executeRequest(request); }
DingTalkServiceImpl implements DingTalkService { @Override public void sendText(String textMessage, String... atMobiles) { log.info("Sending text: {} {}", textMessage, atMobiles); OapiRobotSendRequest request = new OapiRobotSendRequest(); request.setMsgtype("text"); OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text(); text.setContent(textMessage); request.setText(text); if (atMobiles.length != 0) { OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); at.setAtMobiles(Arrays.asList(atMobiles)); request.setAt(at); } executeRequest(request); } }
DingTalkServiceImpl implements DingTalkService { @Override public void sendText(String textMessage, String... atMobiles) { log.info("Sending text: {} {}", textMessage, atMobiles); OapiRobotSendRequest request = new OapiRobotSendRequest(); request.setMsgtype("text"); OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text(); text.setContent(textMessage); request.setText(text); if (atMobiles.length != 0) { OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); at.setAtMobiles(Arrays.asList(atMobiles)); request.setAt(at); } executeRequest(request); } DingTalkServiceImpl(DingTalkSetting dingTalkSetting); }
DingTalkServiceImpl implements DingTalkService { @Override public void sendText(String textMessage, String... atMobiles) { log.info("Sending text: {} {}", textMessage, atMobiles); OapiRobotSendRequest request = new OapiRobotSendRequest(); request.setMsgtype("text"); OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text(); text.setContent(textMessage); request.setText(text); if (atMobiles.length != 0) { OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); at.setAtMobiles(Arrays.asList(atMobiles)); request.setAt(at); } executeRequest(request); } DingTalkServiceImpl(DingTalkSetting dingTalkSetting); @Override void sendText(String textMessage, String... atMobiles); @Override void sendLink(String title, String messageUrl, String text, @Nullable String pictureUrl); void sendMarkdown(String title, String markdownText); }
DingTalkServiceImpl implements DingTalkService { @Override public void sendText(String textMessage, String... atMobiles) { log.info("Sending text: {} {}", textMessage, atMobiles); OapiRobotSendRequest request = new OapiRobotSendRequest(); request.setMsgtype("text"); OapiRobotSendRequest.Text text = new OapiRobotSendRequest.Text(); text.setContent(textMessage); request.setText(text); if (atMobiles.length != 0) { OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); at.setAtMobiles(Arrays.asList(atMobiles)); request.setAt(at); } executeRequest(request); } DingTalkServiceImpl(DingTalkSetting dingTalkSetting); @Override void sendText(String textMessage, String... atMobiles); @Override void sendLink(String title, String messageUrl, String text, @Nullable String pictureUrl); void sendMarkdown(String title, String markdownText);  }