|
@@ -0,0 +1,37 @@
|
|
|
+package com.sky.ioc.service.monitor.impl;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.sky.ioc.config.RestTemplateConfig;
|
|
|
+import com.sky.ioc.service.monitor.MonitorService;
|
|
|
+import com.sky.ioc.tool.ReturnMsg;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.client.RestTemplate;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class MonitorServiceImpl implements MonitorService {
|
|
|
+
|
|
|
+ @Value("${sky.front-server-url}")
|
|
|
+ private String iocServerUrl;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RestTemplateConfig restTemplateConfig;
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ReturnMsg getJobList(String name, String group, String status, String page, String pageSize) {
|
|
|
+ RestTemplate restTemplate = restTemplateConfig.build();
|
|
|
+ Map params = new HashMap<>();
|
|
|
+ params.put("name", name);
|
|
|
+ params.put("group", group);
|
|
|
+ params.put("status", status);
|
|
|
+ params.put("page", page);
|
|
|
+ params.put("page_size", pageSize);
|
|
|
+ JSONObject forObject = restTemplate.postForObject(iocServerUrl + "/quartz_job/getJobList", null, JSONObject.class, params);
|
|
|
+ return ReturnMsg.ok(forObject);
|
|
|
+ }
|
|
|
+}
|