Commit bd87532d authored by 黎博's avatar 黎博

新增执行策略接口

parent 0b6b9a2f
...@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -151,4 +152,22 @@ public class SqlMonitorTaskController { ...@@ -151,4 +152,22 @@ public class SqlMonitorTaskController {
return JsonResult.buildErrorStateResult("发送异常!", false); return JsonResult.buildErrorStateResult("发送异常!", false);
} }
} }
@GetMapping("/strategy")
public JsonResult getSqlMonitorStrategy() {
List<Map<String, String>> strategyList = new ArrayList<>();
Map<String, String> dailyMap = new HashMap<>();
Map<String, String> hourlyMap = new HashMap<>();
hourlyMap.put("value", "0 0 * * * ?");
hourlyMap.put("label", "每小时执行一次");
dailyMap.put("value", "0 0 10 * * ?");
dailyMap.put("label", "每天10点执行一次");
Map<String, String> weeklyMap = new HashMap<>();
weeklyMap.put("value", "0 0 10 ? * 2");
weeklyMap.put("label", "每周一上午10点执行一次");
strategyList.add(hourlyMap);
strategyList.add(dailyMap);
strategyList.add(weeklyMap);
return JsonResult.buildSuccessResult(strategyList);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment