package com.ruoyi.rocketmq.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.InitialOtherSystemMonitorData;
import com.ruoyi.rocketmq.service.IInitialOtherSystemMonitorDataService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;

/**
 * 系统其他信息监控数据Controller
 * 
 * @author gyt
 * @date 2025-09-23
 */
@RestController
@RequestMapping("/otherSystemData")
public class InitialOtherSystemMonitorDataController extends BaseController
{
    @Autowired
    private IInitialOtherSystemMonitorDataService initialOtherSystemMonitorDataService;

    /**
     * 查询系统其他信息监控数据列表
     */
    @RequiresPermissions("rocketmq:otherSystemData:list")
    @GetMapping("/list")
    public TableDataInfo list(InitialOtherSystemMonitorData initialOtherSystemMonitorData)
    {
        startPage();
        List<InitialOtherSystemMonitorData> list = initialOtherSystemMonitorDataService.selectInitialOtherSystemMonitorDataList(initialOtherSystemMonitorData);
        return getDataTable(list);
    }

    /**
     * 导出系统其他信息监控数据列表
     */
    @RequiresPermissions("rocketmq:otherSystemData:export")
    @Log(title = "系统其他信息监控数据", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, InitialOtherSystemMonitorData initialOtherSystemMonitorData)
    {
        List<InitialOtherSystemMonitorData> list = initialOtherSystemMonitorDataService.selectInitialOtherSystemMonitorDataList(initialOtherSystemMonitorData);
        ExcelUtil<InitialOtherSystemMonitorData> util = new ExcelUtil<InitialOtherSystemMonitorData>(InitialOtherSystemMonitorData.class);
        util.exportExcel(response, list, "系统其他信息监控数据数据");
    }

    /**
     * 获取系统其他信息监控数据详细信息
     */
    @RequiresPermissions("rocketmq:otherSystemData:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(initialOtherSystemMonitorDataService.selectInitialOtherSystemMonitorDataById(id));
    }

    /**
     * 新增系统其他信息监控数据
     */
    @RequiresPermissions("rocketmq:otherSystemData:add")
    @Log(title = "系统其他信息监控数据", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody InitialOtherSystemMonitorData initialOtherSystemMonitorData)
    {
        return toAjax(initialOtherSystemMonitorDataService.insertInitialOtherSystemMonitorData(initialOtherSystemMonitorData));
    }

    /**
     * 修改系统其他信息监控数据
     */
    @RequiresPermissions("rocketmq:otherSystemData:edit")
    @Log(title = "系统其他信息监控数据", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody InitialOtherSystemMonitorData initialOtherSystemMonitorData)
    {
        return toAjax(initialOtherSystemMonitorDataService.updateInitialOtherSystemMonitorData(initialOtherSystemMonitorData));
    }

    /**
     * 删除系统其他信息监控数据
     */
    @RequiresPermissions("rocketmq:otherSystemData:remove")
    @Log(title = "系统其他信息监控数据", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(initialOtherSystemMonitorDataService.deleteInitialOtherSystemMonitorDataByIds(ids));
    }
}
