| | |
| | | |
| | | @GetMapping(PREFIX + "/schedule-scheme/list") |
| | | @Operation(summary = "获取调度方案列表") |
| | | List<StScheduleSchemeDTO> listScheduleScheme(@RequestParam Map<String, Object> params); |
| | | List<StScheduleSchemeDTO> listScheduleScheme(@RequestParam("triggerMethod") String triggerMethod, @RequestParam("triggerCondition") String triggerCondition); |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 调度模型触发方式 |
| | | * |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年12月31日 |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ScheduleTriggerMethodEnum { |
| | | |
| | | EVENT("1", "事件触发"), |
| | | JOB("2", "定时触发"); |
| | | |
| | | private String code; |
| | | private String desc; |
| | | |
| | | public static ScheduleTriggerMethodEnum getEumByCode(String code) { |
| | | if (code == null) { |
| | | return null; |
| | | } |
| | | |
| | | for (ScheduleTriggerMethodEnum statusEnum : ScheduleTriggerMethodEnum.values()) { |
| | | if (statusEnum.getCode().equals(code)) { |
| | | return statusEnum; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<StScheduleSchemeDTO> listScheduleScheme(Map<String, Object> params) { |
| | | public List<StScheduleSchemeDTO> listScheduleScheme(String triggerMethod, String triggerCondition) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("triggerMethod", triggerMethod); |
| | | params.put("triggerCondition", triggerCondition); |
| | | return stScheduleSchemeService.list(params); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<StScheduleSchemeDTO> list(Map<String, Object> params) { |
| | | QueryWrapper<StScheduleSchemeEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("trigger_method", params.get("trigger_method")); |
| | | queryWrapper.eq("trigger_condition", params.get("trigger_condition")); |
| | | queryWrapper.eq("trigger_method", params.get("triggerMethod")); |
| | | queryWrapper.eq("trigger_condition", params.get("triggerCondition")); |
| | | List<StScheduleSchemeEntity> list = baseDao.selectList(queryWrapper); |
| | | return ConvertUtils.sourceToTarget(list, StScheduleSchemeDTO.class); |
| | | } |