package com.zksy.web.controller.base;

import com.zksy.base.domain.AlarmAssignDetail;
import com.zksy.base.service.IAlarmAssignDetailService;
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("/alarmAssignDetail")
@Api(tags = "报警清单处理明细")
public class AlarmAssignDetailController extends BaseController
{
    @Autowired
    private IAlarmAssignDetailService alarmAssignDetailService;

    /**
     * 获取报警清单处理明细详细信息
     */
    @Anonymous
    @GetMapping(value = "/getById/{id}")
    @ApiOperation(value = "获取报警清单处理明细详细信息")
    public AjaxResult2<AlarmAssignDetail> getById(@PathVariable("id") Long id)
    {
        return AjaxResult2.success(alarmAssignDetailService.selectAlarmAssignDetailByAlarmAssignDetailId(id));
    }

    /**
     * 新增报警清单处理明细
     */
    @Anonymous
    @PostMapping(value = "/save")
    @ApiOperation(value = "新增报警清单处理明细")
    public AjaxResult save(@RequestBody AlarmAssignDetail alarmAssignDetail)
    {
        return toAjax(alarmAssignDetailService.insertAlarmAssignDetail(alarmAssignDetail));
    }

    /**
     * 修改报警清单处理明细
     */
    @Anonymous
    @PostMapping(value = "/update")
    @ApiOperation(value = "修改报警清单处理明细")
    public AjaxResult update(@RequestBody AlarmAssignDetail alarmAssignDetail)
    {
        return toAjax(alarmAssignDetailService.updateAlarmAssignDetail(alarmAssignDetail));
    }

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