官方文檔
文檔
術語介紹
引入pom
<dependency><groupId>com.github.binarywang</groupId><artifactId>wx-java-cp-spring-boot-starter</artifactId><version>4.5.3.B</version></dependency>
核心代碼
推送消息
final WxCpService wxCpService = WxCpConfiguration.getCpService(agentId);if (wxCpService == null) {throw new IllegalArgumentException(String.format("未找到對應agentId=[%d]的配置,請核實!", agentId));}
// https://developer.work.weixin.qq.com/document/10013return wxCpService.getMessageService().send( WxCpMessage.TEXT().content("一條消息內容2222").toUser("xxxx").toParty("2").build());
自建應用
登錄 后臺 https://work.weixin.qq.com/wework_admin/frame#apps,新建應用
可以獲取 AgentId