11111
parent
6ae8f463e9
commit
f18981b34c
|
@ -57,6 +57,7 @@ public class EtlRuleController {
|
||||||
|
|
||||||
List<EtlRuleResp> list = etlRuleService.selectList(req);
|
List<EtlRuleResp> list = etlRuleService.selectList(req);
|
||||||
|
|
||||||
|
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,7 @@ import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:张承志
|
* @Author:张承志
|
||||||
|
@ -47,7 +44,33 @@ public class RuleEngineVersionController {
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 激活引擎请求
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/activate/{id}")
|
||||||
|
@Operation(summary = "规则引擎的激活", description = "通过Id激活规则引擎")
|
||||||
|
public Result activate(@PathVariable("id") Long id){
|
||||||
|
|
||||||
|
versionService.activate(id);
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消引擎请求
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/disable/{id}")
|
||||||
|
@Operation(summary = "规则引擎的取消", description = "通过Id取消规则引擎")
|
||||||
|
public Result disable(@PathVariable("id") Long id){
|
||||||
|
|
||||||
|
versionService.disable(id);
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ public interface RuleEngineVersionService extends IService<RuleEngineVersion> {
|
||||||
List<RuleEngineVersion> selectRuleEngineVersion(Long id);
|
List<RuleEngineVersion> selectRuleEngineVersion(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
void activate(Long id);
|
||||||
|
|
||||||
|
void disable(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,11 @@ package com.muyu.rule.server.service.impl;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.common.core.enums.SystemYesNo;
|
||||||
|
import com.muyu.rule.common.domain.RuleEngine;
|
||||||
import com.muyu.rule.common.domain.RuleEngineVersion;
|
import com.muyu.rule.common.domain.RuleEngineVersion;
|
||||||
import com.muyu.rule.server.mapper.RuleEngineVersionMapper;
|
import com.muyu.rule.server.mapper.RuleEngineVersionMapper;
|
||||||
import com.muyu.rule.server.service.RuleEngineVersionService;
|
import com.muyu.rule.server.service.RuleEngineVersionService;
|
||||||
|
@ -36,4 +39,33 @@ public class RuleEngineServiceImpl extends ServiceImpl<RuleEngineVersionMapper,R
|
||||||
return versionList;
|
return versionList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void activate(Long id) {
|
||||||
|
this.updateOpen(id, SystemYesNo.YES.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disable(Long id) {
|
||||||
|
this.updateOpen(id, SystemYesNo.NO.getCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改激活
|
||||||
|
* @param id
|
||||||
|
* @param open
|
||||||
|
*/
|
||||||
|
public void updateOpen(Long id, String open){
|
||||||
|
|
||||||
|
|
||||||
|
UpdateWrapper<RuleEngineVersion> updateWrapper = new UpdateWrapper<>();
|
||||||
|
|
||||||
|
updateWrapper.eq("id",id).set("open",open);
|
||||||
|
|
||||||
|
this.update(updateWrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue