package com.huimv.produce.warning.controller;


import com.huimv.common.utils.Result;
import com.huimv.produce.warning.service.IBaseWarningInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2021-12-02
 */
@RestController
@RequestMapping("/warningInfo")
public class BaseWarningInfoController {
    @Autowired
    private IBaseWarningInfoService warningInfoService;

    @PostMapping("/listWarningInfoZoology")
    public Result listWarningInfoZoology(@RequestBody Map<String, String> map ) {
        return warningInfoService.listWarningInfoZoology(map);
    }

    @PostMapping("/listWarningInfoSewage")
    public Result listWarningInfoSewage(@RequestBody Map<String, String> map ) {
        return warningInfoService.listWarningInfoSewage(map);
    }


    @PostMapping("/listWarningInfo")
    public Result listWarningInfo(@RequestBody Map<String, String> map ) {
        return warningInfoService.listWarningInfo(map);
    }

    @PostMapping("/listWarningInfoScreen")
    public Result listWarningInfoScreen(@RequestBody Map<String, String> map ) {
        return warningInfoService.listWarningInfoScreen(map);
    }

    @PostMapping("/listAllWarning")
    public Result listAllWarning(@RequestBody Map<String, String> map ) {
        return warningInfoService.listAllWarning(map);
    }


    @PostMapping("/setWarningStatus")
    public Result setWarningStatus(@RequestBody Map<String, String> map ) {
        return warningInfoService.setWarningStatus(map);
    }

    @PostMapping("/getLastWarning")
    public Result getLastWarning(@RequestBody Map<String, String> map ) {
        return warningInfoService.getLastWarning(map);
    }
    @PostMapping("/newAlarm")
    public Result newAlarm(@RequestBody Map<String, String> map ) throws ParseException {
        return warningInfoService.newAlarm(map);
    }


}
