package com.rongwei.savecheck.controller;

import com.rongwei.rwcommon.base.R;
import com.rongwei.sfcommon.sys.service.impl.HazardInvestigationServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * HazardInvestigationController class
 *
 * @author XH
 * @date 2024/08/09
 */
@RestController
@RequestMapping("/hazard-investigation")
public class HazardInvestigationController {
    private final Logger log = LoggerFactory.getLogger(this.getClass().getName());
    @Autowired
    private HazardInvestigationServiceImpl hazardInvestigationService;

    /**
     * 生成隐患排查任务
     *
     * @param map
     * @return
     */
    @GetMapping("/create/task/{id}")
    public R createTask(@PathVariable(name = "id") String id) {
        log.info("根据模板: {}生成隐患排查任务", id);
        return hazardInvestigationService.createTask(id);
    }

}
