|
|
@@ -0,0 +1,33 @@
|
|
|
+package com.usoftchina.uas.office.qywx;
|
|
|
+
|
|
|
+import com.usoftchina.qywx.sdk.RobMessageSdk;
|
|
|
+import com.usoftchina.qywx.sdk.config.QywxProperties;
|
|
|
+import com.usoftchina.qywx.sdk.dto.SendRobMessageReq;
|
|
|
+//import org.junit.Test;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author yingp
|
|
|
+ * @date 2020/2/21
|
|
|
+ */
|
|
|
+public class MessageTest {
|
|
|
+ private static RobMessageSdk sdk;
|
|
|
+ static {
|
|
|
+ sdk = new RobMessageSdk(new QywxProperties());
|
|
|
+ }
|
|
|
+
|
|
|
+// @Test
|
|
|
+ public void sendProcessMessage() throws Exception {
|
|
|
+ String text = "消息测试";
|
|
|
+ String[] mentionedList = new String[]{"U0815","@all"};
|
|
|
+ String[] mentionedMobileList = new String[]{"13699876151","@all"};
|
|
|
+ String key="263a7170-3197-4ff5-8a29-be42b646a546";
|
|
|
+ System.out.println("BEGIN ");
|
|
|
+ try {
|
|
|
+ sdk.send(key,new SendRobMessageReq().text(text,mentionedList,mentionedMobileList));
|
|
|
+ }catch (Exception e){
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
+ System.out.println("END ");
|
|
|
+ }
|
|
|
+}
|