package com.muyu.controller;


import java.util.List;
import com.muyu.service.WarnLogsService;


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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.domain.WarnLogs ;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil;
import org.springframework.validation.annotation.Validated;
import com.muyu.common.core.web.page.TableDataInfo;

/**
 * 预警日志Controller
 *
 * @author sx
 * @date 2024-09-20
 */
@RestController
@RequestMapping("/logs")
public class WarnLogsController extends BaseController
{
    @Autowired
    private WarnLogsService warnLogsService;

    /**
     * 查询预警日志列表
     */
    @GetMapping("/selectWarnLogsList")
    public Result  selectWarnLogsList(){
        return Result.success(warnLogsService.selectWarnLogsList());
    }


    /**
     * 获取预警日志详细信息
     */
    @GetMapping(value = "selectWarnLogsById/{id}")
    public Result selectWarnLogsById(@PathVariable("id") Long id)
    {
        return success(warnLogsService.selectWarnLogsById(id));
    }

    /**
     * 新增预警日志
     */
    @PostMapping("/addWarnLogs")
    public Result<Integer> addWarnLogs(@RequestBody WarnLogs warnLogs)
    {
        int i = warnLogsService.addWarnLogs(warnLogs);
        return i>0?Result.success():Result.error();
    }

}
