Java SDK 指南
轻推JAVA-SDK是轻推开放平台面向Java开发者提供的发工具包。通过使用轻推JAVA-SDK,Java开发者可借助轻推高效地使用消息推送,安全登录等功能。
步骤一:获取AppID以及AppSecret
登录轻推企业管理系统,编辑轻应用/订阅号,获取AppID以及AppSecret,若需要使用轻推安全登录则需要填写安全域名。
步骤二:引入 SDK 文件
上传轻推JAVA-SDK到公司仓库,然后引入
<dependency>
<groupId>com.qingtui.open</groupId>
<artifactId>qingtui-open-spring-boot-starter</artifactId>
<version>7.12.0</version>
</dependency>
步骤三:填写配置文件
ymal 增加配置
qingtui.open:
appId: ""
appSecret: ""
url: "https://open.qingtui.com" #私有化部署修改此地址
步骤四:项目中使用
下面介绍了怎么通过UserService获取员工信息
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
public class UserServiceTest {
@Autowired
UserService openMemberService;
@Test
public void getUser() {
val result = openMemberService.getUser("25d65918c6d1524ccd24a722639ef694");
log.info("{}", result);
}
}