agent2.0版本数据适配,开发脚本策略接口

This commit is contained in:
gaoyutao
2025-09-23 18:21:05 +08:00
parent a9270027f4
commit d5f232e295
62 changed files with 5286 additions and 44 deletions

View File

@@ -0,0 +1,112 @@
package com.ruoyi.rocketmq.controller;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageDomain;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.RmDeploymentPolicy;
import com.ruoyi.rocketmq.service.IRmDeploymentPolicyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 服务器脚本策略Controller
*
* @author gyt
* @date 2025-09-15
*/
@RestController
@RequestMapping("/policy")
public class RmDeploymentPolicyController extends BaseController
{
@Autowired
private IRmDeploymentPolicyService rmDeploymentPolicyService;
/**
* 查询服务器脚本策略列表
*/
@RequiresPermissions("rocketmq:policy:list")
@PostMapping("/list")
public TableDataInfo list(@RequestBody RmDeploymentPolicy rmDeploymentPolicy)
{
PageDomain pageDomain = new PageDomain();
pageDomain.setPageNum(rmDeploymentPolicy.getPageNum());
pageDomain.setPageSize(rmDeploymentPolicy.getPageSize());
startPage(pageDomain);
List<RmDeploymentPolicy> list = rmDeploymentPolicyService.selectRmDeploymentPolicyList(rmDeploymentPolicy);
return getDataTable(list);
}
/**
* 导出服务器脚本策略列表
*/
@RequiresPermissions("rocketmq:policy:export")
@Log(title = "服务器脚本策略", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RmDeploymentPolicy rmDeploymentPolicy)
{
List<RmDeploymentPolicy> list = rmDeploymentPolicyService.selectRmDeploymentPolicyList(rmDeploymentPolicy);
ExcelUtil<RmDeploymentPolicy> util = new ExcelUtil<RmDeploymentPolicy>(RmDeploymentPolicy.class);
util.exportExcel(response, list, "服务器脚本策略数据");
}
/**
* 获取服务器脚本策略详细信息
*/
@RequiresPermissions("rocketmq:policy:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(rmDeploymentPolicyService.selectRmDeploymentPolicyById(id));
}
/**
* 新增服务器脚本策略
*/
@RequiresPermissions("rocketmq:policy:add")
@Log(title = "服务器脚本策略", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RmDeploymentPolicy rmDeploymentPolicy)
{
return toAjax(rmDeploymentPolicyService.insertRmDeploymentPolicy(rmDeploymentPolicy));
}
/**
* 修改服务器脚本策略
*/
@RequiresPermissions("rocketmq:policy:edit")
@Log(title = "服务器脚本策略", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RmDeploymentPolicy rmDeploymentPolicy)
{
return toAjax(rmDeploymentPolicyService.updateRmDeploymentPolicy(rmDeploymentPolicy));
}
/**
* 删除服务器脚本策略
*/
@RequiresPermissions("rocketmq:policy:remove")
@Log(title = "服务器脚本策略", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(rmDeploymentPolicyService.deleteRmDeploymentPolicyByIds(ids));
}
/**
* 下发服务器脚本策略
*/
@RequiresPermissions("rocketmq:policy:list")
@GetMapping(value = "/issueDeploymentPolicy")
public AjaxResult issueDeploymentPolicy(Long id)
{
return success(rmDeploymentPolicyService.issueDeploymentPolicy(id));
}
}