package com.tuoheng.admin.controller;

import com.tuoheng.admin.entity.request.warningrecord.QueryWarningRecordByEmergencyMissionIdRequest;
import com.tuoheng.admin.entity.request.warningrecord.QueryWarningRecordListByWarningIdRequest;
import com.tuoheng.admin.service.warningrecord.IWarningRecordService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @desc: 预警记录 前端控制器
 * @team: tuoheng
 * @author: wanjing
 * @date: 2023-02-06
 */
@RestController
@RequestMapping("/warning/record")
public class WarningRecordController {

    @Autowired
    private IWarningRecordService warningRecordService;

    /**
     * 查询预警记录列表
     */
    @GetMapping("/list/by/warningid")
    public JsonResult getListByWarningId(QueryWarningRecordListByWarningIdRequest request) {
        return warningRecordService.getListByWarningId(request);
    }

    /**
     * 根据应急任务ID查询预警记录
     */
    @GetMapping("/one/by/emergencyMissionId")
    public JsonResult getOneByEmergencyMissionId(QueryWarningRecordByEmergencyMissionIdRequest request) {
        return warningRecordService.getOneByEmergencyMissionId(request);
    }

}
