115 lines
3.4 KiB
Java
115 lines
3.4 KiB
Java
package com.muyu.controller;
|
||
import com.muyu.common.core.domain.Result;
|
||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||
import com.muyu.common.core.web.controller.BaseController;
|
||
import com.muyu.domain.EngineMaintenance;
|
||
import com.muyu.req.EngineMaintenanceQueryReq;
|
||
import com.muyu.req.EngineVersionListResp;
|
||
import com.muyu.service.EngIneService;
|
||
import jakarta.servlet.http.HttpServletResponse;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
import org.springframework.web.bind.annotation.*;
|
||
import java.util.List;
|
||
/**
|
||
* @Author:qdm
|
||
* @Package:com.muyu.controller
|
||
* @Project:cloud-etl-engine
|
||
* @name:EngIneController
|
||
* @Date:2024/8/22 15:36
|
||
*/
|
||
@RestController
|
||
@RequestMapping("/engine")
|
||
public class EngIneController extends BaseController {
|
||
|
||
@Autowired
|
||
EngIneService engIneService;
|
||
|
||
@PostMapping("/getMaintenanceList")
|
||
public Result<List<EngineMaintenance>> getMaintenanceList(@RequestBody EngineMaintenanceQueryReq engineMaintenanceQueryReq) {
|
||
List<EngineMaintenance> list = engIneService.getMaintenanceList(engineMaintenanceQueryReq);
|
||
return Result.success(list);
|
||
}
|
||
|
||
public static void main(String[] args) {
|
||
System.out.println("你好");
|
||
}
|
||
|
||
|
||
@DeleteMapping("/{ids}")
|
||
public Integer remove(@PathVariable(name = "ids") String ids) {
|
||
return engIneService.deleteByIds(ids);
|
||
}
|
||
|
||
@PostMapping("/update")
|
||
public Result<EngineMaintenance> update(@RequestBody EngineMaintenance engineMaintenance){
|
||
return engIneService.updateMsg(engineMaintenance);
|
||
}
|
||
|
||
|
||
@PostMapping("/insert")
|
||
public Result<EngineMaintenance> insert(@RequestBody EngineMaintenance engineMaintenance){
|
||
return engIneService.add(engineMaintenance);
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
/**
|
||
* 查询规则引擎版本列表
|
||
*/
|
||
@PutMapping("/getRuleEngineInfo/{id}")
|
||
public Result getRuleEngineInfo(@PathVariable(name = "id") Long id) {
|
||
EngineVersionListResp engineConfigListResp = engIneService.getRuleEngineInfo(id);
|
||
return Result.success(engineConfigListResp);
|
||
}
|
||
|
||
/**
|
||
* 导出
|
||
*/
|
||
@PostMapping("/export")
|
||
public void export(HttpServletResponse httpServletResponse, EngineMaintenance engineMaintenance) {
|
||
List<EngineMaintenance> list = engIneService.list();
|
||
ExcelUtil<EngineMaintenance> engineMaintenanceExcelUtil = new ExcelUtil<>(EngineMaintenance.class);
|
||
engineMaintenanceExcelUtil.exportExcel(httpServletResponse, list, "规则引擎版本");
|
||
}
|
||
|
||
/**
|
||
* 通过引擎维护编号禁用引擎
|
||
*/
|
||
@PostMapping("/forbiddenEngine/{id}")
|
||
public Result forbiddenEngine(@PathVariable Integer id) {
|
||
engIneService.forbiddenEngine(id);
|
||
return Result.success();
|
||
}
|
||
|
||
/**
|
||
* 通过引擎维护编号开启引擎
|
||
*/
|
||
@PostMapping("/onEngine/{id}")
|
||
public Result onEngine(@PathVariable Integer id) {
|
||
engIneService.onEngine(id);
|
||
return Result.success();
|
||
}
|
||
|
||
/**
|
||
* 通过引擎维护编号关闭引擎
|
||
*/
|
||
@PostMapping("/closeEngine/{id}")
|
||
public Result closeEngine(@PathVariable Integer id) {
|
||
engIneService.closeEngine(id);
|
||
return Result.success();
|
||
}
|
||
|
||
/**
|
||
* 通过引擎维护编号激活引擎
|
||
*/
|
||
@PostMapping("/activateEngine/{id}")
|
||
public Result activateEngine(@PathVariable Integer id) {
|
||
engIneService.activateEngine(id);
|
||
return Result.success();
|
||
}
|
||
}
|