Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
package com.solution.web.controller.algo;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.solution.common.annotation.Log;
|
||||
import com.solution.common.core.controller.BaseController;
|
||||
import com.solution.common.core.domain.AjaxResult;
|
||||
import com.solution.common.enums.BusinessType;
|
||||
import com.solution.algo.domain.Algorithm;
|
||||
import com.solution.algo.service.IAlgorithmService;
|
||||
import com.solution.common.utils.poi.ExcelUtil;
|
||||
import com.solution.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 规则Controller
|
||||
*
|
||||
* @author zouju
|
||||
* @date 2026-02-06
|
||||
*/
|
||||
@RestController
|
||||
@Api("规则模块")
|
||||
@RequestMapping("/algo/algorithm")
|
||||
public class AlgorithmController extends BaseController {
|
||||
@Autowired
|
||||
private IAlgorithmService algorithmService;
|
||||
|
||||
/**
|
||||
* 查询规则列表
|
||||
*/
|
||||
@ApiOperation("查询规则列表")
|
||||
@PreAuthorize("@ss.hasPermi('algo:algorithm:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Algorithm algorithm) {
|
||||
startPage();
|
||||
List<Algorithm> list = algorithmService.selectAlgorithmList(algorithm);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出规则列表
|
||||
*/
|
||||
@ApiOperation("导出规则列表")
|
||||
@PreAuthorize("@ss.hasPermi('algo:algorithm:export')")
|
||||
@Log(title = "规则", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Algorithm algorithm) {
|
||||
List<Algorithm> list = algorithmService.selectAlgorithmList(algorithm);
|
||||
ExcelUtil<Algorithm> util = new ExcelUtil<Algorithm>(Algorithm.class);
|
||||
util.exportExcel(response, list, "规则数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取规则详细信息
|
||||
*/
|
||||
@ApiOperation("获取规则详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('algo:algorithm:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(algorithmService.selectAlgorithmById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增规则
|
||||
*/
|
||||
@ApiOperation("新增规则")
|
||||
@PreAuthorize("@ss.hasPermi('algo:algorithm:add')")
|
||||
@Log(title = "规则", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Algorithm algorithm) {
|
||||
return toAjax(algorithmService.insertAlgorithm(algorithm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改规则
|
||||
*/
|
||||
@ApiOperation("修改规则")
|
||||
@PreAuthorize("@ss.hasPermi('algo:algorithm:edit')")
|
||||
@Log(title = "规则", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Algorithm algorithm) {
|
||||
return toAjax(algorithmService.updateAlgorithm(algorithm));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规则
|
||||
*/
|
||||
@ApiOperation("删除规则")
|
||||
@PreAuthorize("@ss.hasPermi('algo:algorithm:remove')")
|
||||
@Log(title = "规则", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(algorithmService.deleteAlgorithmByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
package com.solution.web.controller.algo;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.solution.common.annotation.Log;
|
||||
import com.solution.common.core.controller.BaseController;
|
||||
import com.solution.common.core.domain.AjaxResult;
|
||||
import com.solution.common.enums.BusinessType;
|
||||
import com.solution.algo.domain.SysAlgoConfig;
|
||||
import com.solution.algo.service.ISysAlgoConfigService;
|
||||
import com.solution.common.utils.poi.ExcelUtil;
|
||||
import com.solution.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 动态规则配置Controller
|
||||
*
|
||||
* @author zouju
|
||||
* @date 2026-02-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/algo/algo")
|
||||
public class SysAlgoConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysAlgoConfigService sysAlgoConfigService;
|
||||
|
||||
/**
|
||||
* 查询动态规则配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('algo:algo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysAlgoConfig sysAlgoConfig)
|
||||
{
|
||||
startPage();
|
||||
List<SysAlgoConfig> list = sysAlgoConfigService.selectSysAlgoConfigList(sysAlgoConfig);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出动态规则配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('algo:algo:export')")
|
||||
@Log(title = "动态规则配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysAlgoConfig sysAlgoConfig)
|
||||
{
|
||||
List<SysAlgoConfig> list = sysAlgoConfigService.selectSysAlgoConfigList(sysAlgoConfig);
|
||||
ExcelUtil<SysAlgoConfig> util = new ExcelUtil<SysAlgoConfig>(SysAlgoConfig.class);
|
||||
util.exportExcel(response, list, "动态规则配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取动态规则配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('algo:algo:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysAlgoConfigService.selectSysAlgoConfigById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增动态规则配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('algo:algo:add')")
|
||||
@Log(title = "动态规则配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysAlgoConfig sysAlgoConfig)
|
||||
{
|
||||
return toAjax(sysAlgoConfigService.insertSysAlgoConfig(sysAlgoConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改动态规则配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('algo:algo:edit')")
|
||||
@Log(title = "动态规则配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysAlgoConfig sysAlgoConfig)
|
||||
{
|
||||
return toAjax(sysAlgoConfigService.updateSysAlgoConfig(sysAlgoConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除动态规则配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('algo:algo:remove')")
|
||||
@Log(title = "动态规则配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysAlgoConfigService.deleteSysAlgoConfigByIds(ids));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user