mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
770 B
770 B
STEP4: OpenAPI
OpenAPI允许开发者通过接口来完成手工的操作,让系统整体变得更加灵活,启用OpenAPI需要依赖
oh-my-scheduler-client
库。
<dependency>
<groupId>com.github.kfcfans</groupId>
<artifactId>oh-my-scheduler-client</artifactId>
<version>${oms.client.latest.version}</version>
</dependency>
简单示例
// 初始化 client,需要server地址和应用名称作为参数
OhMyClient ohMyClient = new OhMyClient("127.0.0.1:7700", "oms-test");
// 调用相关的API
ohMyClient.stopInstance(1586855173043L)