技术要求:规则展示表格接口
This commit is contained in:
@@ -6,7 +6,10 @@ import com.solution.common.core.domain.AjaxResult;
|
||||
import com.solution.common.core.page.TableDataInfo;
|
||||
import com.solution.common.enums.BusinessType;
|
||||
import com.solution.rule.domain.Rule;
|
||||
import com.solution.rule.domain.config.RuleConfig;
|
||||
import com.solution.rule.domain.config.RuleConfigQuery;
|
||||
import com.solution.rule.service.IRuleService;
|
||||
import com.solution.rule.service.IRuleConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -22,6 +25,8 @@ public class RuleController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IRuleService ruleService;
|
||||
@Autowired
|
||||
private IRuleConfigService ruleConfigService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:rule:list')")
|
||||
@GetMapping("/list")
|
||||
@@ -62,4 +67,50 @@ public class RuleController extends BaseController {
|
||||
public AjaxResult remove(@PathVariable Integer[] ids) {
|
||||
return toAjax(ruleService.deleteRuleByIds(ids));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:rule:list')")
|
||||
@GetMapping("/config/list")
|
||||
@ApiOperation("查询规则聚合列表")
|
||||
public TableDataInfo configList(RuleConfigQuery query) {
|
||||
startPage();
|
||||
return getDataTable(ruleConfigService.selectRuleConfigList(query));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:rule:query')")
|
||||
@GetMapping("/config/{ruleCode}")
|
||||
@ApiOperation("查询规则聚合详情")
|
||||
public AjaxResult configInfo(@PathVariable String ruleCode) {
|
||||
return success(ruleConfigService.selectRuleConfigByCode(ruleCode));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:rule:add')")
|
||||
@Log(title = "规则聚合管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/config")
|
||||
@ApiOperation("新增规则聚合")
|
||||
public AjaxResult addConfig(@RequestBody RuleConfig ruleConfig) {
|
||||
return toAjax(ruleConfigService.insertRuleConfig(ruleConfig));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:rule:edit')")
|
||||
@Log(title = "规则聚合管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/config")
|
||||
@ApiOperation("修改规则聚合")
|
||||
public AjaxResult editConfig(@RequestBody RuleConfig ruleConfig) {
|
||||
return toAjax(ruleConfigService.updateRuleConfig(ruleConfig));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:rule:remove')")
|
||||
@Log(title = "规则聚合管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/config/{ruleCodes}")
|
||||
@ApiOperation("删除规则聚合")
|
||||
public AjaxResult removeConfig(@PathVariable String[] ruleCodes) {
|
||||
return toAjax(ruleConfigService.deleteRuleConfigByCodes(ruleCodes));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:rule:query')")
|
||||
@GetMapping("/config/dict/{dictType}")
|
||||
@ApiOperation("按类型查询规则字典")
|
||||
public AjaxResult dict(@PathVariable String dictType) {
|
||||
return success(ruleConfigService.selectDictByType(dictType));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user