|
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Service;
|
|
@Slf4j
|
|
@Slf4j
|
|
@Service
|
|
@Service
|
|
public class CorpWeixinServiceImpl implements ICorpWeixinService {
|
|
public class CorpWeixinServiceImpl implements ICorpWeixinService {
|
|
- public static void main(String[] args) {
|
|
|
|
|
|
+/* public static void main(String[] args) {
|
|
val configStorage = new WxCpDefaultConfigImpl();
|
|
val configStorage = new WxCpDefaultConfigImpl();
|
|
configStorage.setCorpId("ww24b8a47826f5875f");
|
|
configStorage.setCorpId("ww24b8a47826f5875f");
|
|
configStorage.setAgentId(1000017);
|
|
configStorage.setAgentId(1000017);
|
|
@@ -36,5 +36,32 @@ public class CorpWeixinServiceImpl implements ICorpWeixinService {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ val configStorage = new WxCpDefaultConfigImpl();
|
|
|
|
+ configStorage.setCorpId("ww24b8a47826f5875f");
|
|
|
|
+ configStorage.setAgentId(1000004);
|
|
|
|
+ configStorage.setCorpSecret("1YWGDtuZWrQDl6US3OPHG8_pvuNgP1TeUsOmfRk6GmQ");
|
|
|
|
+ /* configStorage.setToken("hcst2019");
|
|
|
|
+ configStorage.setAesKey("hcst2019");*/
|
|
|
|
+ val service = new WxCpServiceImpl();
|
|
|
|
+
|
|
|
|
+ service.setWxCpConfigStorage(configStorage);
|
|
|
|
+ WxCpOAuth2Service wxCpOAuth2Service = new WxCpOAuth2ServiceImpl(service);
|
|
|
|
+ try {
|
|
|
|
+ WxCpMessage message = new WxCpMessage();
|
|
|
|
+ message.setToUser("YuMeng");
|
|
|
|
+ message.setAgentId(1000004);
|
|
|
|
+ message.setContent("测试消息");
|
|
|
|
+ message.setMsgType("text");
|
|
|
|
+ service.messageSend(message);
|
|
|
|
+// service.post("https://qyapi.weixin.qq.com/cgi-bin/message/send","touser=YiErSanSi&content=123&agentid=1000002&msgtype=text");
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|