package com.zksy.web.controller.base;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zksy.base.domain.AlarmAssignList;
import com.zksy.base.dto.AlarmAssignListPageInDTO;
import com.zksy.base.service.IAlarmAssignListService;
import com.zksy.common.annotation.Anonymous;
import com.zksy.common.core.controller.BaseController;
import com.zksy.common.core.domain.AjaxResult;
import com.zksy.common.core.domain.AjaxResult2;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 报警清单Controller
 * 
 * @author zksy
 * @date 2026-05-06
 */
@RestController
@RequestMapping("/alarmAssignList")
@Api(tags = "报警清单")
public class AlarmAssignListController extends BaseController
{
    @Autowired
    private IAlarmAssignListService alarmAssignListService;

    /**
     * 分页查询报警清单列表
     */
    @Anonymous
    @GetMapping(value = "/findByPage")
    @ApiOperation(value = "分页查询报警清单列表")
    public AjaxResult2<Page<AlarmAssignList>> findByPage(@RequestBody AlarmAssignListPageInDTO pageInDTO)
    {
        return AjaxResult2.success(alarmAssignListService.findByPage(pageInDTO));
    }

    /**
     * 导出报警清单列表
     */
    /*@Anonymous
    @PostMapping("/export")
    @ApiOperation(value = "导出报警清单列表")
    public void export(HttpServletResponse response, AlarmAssignList alarmAssignList)
    {
        List<AlarmAssignList> list = alarmAssignListService.selectAlarmAssignListList(alarmAssignList);
        ExcelUtil<AlarmAssignList> util = new ExcelUtil<AlarmAssignList>(AlarmAssignList.class);
        util.exportExcel(response, list, "报警清单数据");
    }*/

    /**
     * 获取报警清单详细信息
     */
    @Anonymous
    @GetMapping(value = "/getById/{id}")
    @ApiOperation(value = "获取报警清单详细信息")
    public AjaxResult2<AlarmAssignList> getById(@PathVariable("id") Long id)
    {
        return AjaxResult2.success(alarmAssignListService.selectAlarmAssignListByAlarmAssignId(id));
    }

    /**
     * 新增报警清单
     */
    @Anonymous
    @PostMapping(value = "/save")
    @ApiOperation(value = "新增报警清单")
    public AjaxResult save(@RequestBody AlarmAssignList alarmAssignList)
    {
        return toAjax(alarmAssignListService.insertAlarmAssignList(alarmAssignList));
    }

    /**
     * 修改报警清单
     */
    @Anonymous
    @PostMapping(value = "/update")
    @ApiOperation(value = "修改报警清单")
    public AjaxResult update(@RequestBody AlarmAssignList alarmAssignList)
    {
        return toAjax(alarmAssignListService.updateAlarmAssignList(alarmAssignList));
    }

    /**
     * 批量删除报警清单
     */
    @Anonymous
    @PostMapping(value = "/deleteBatch")
    @ApiOperation(value = "批量删除报警清单")
    public AjaxResult deleteBatch(@RequestBody Long[] ids)
    {
        return toAjax(alarmAssignListService.deleteAlarmAssignListByAlarmAssignIds(ids));
    }
}
