package com.goldenwater.slaj.hazard.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.goldenwater.common.core.controller.BaseController;
import com.goldenwater.common.core.domain.AjaxResult;
import com.goldenwater.common.core.page.TableDataInfo;
import com.goldenwater.slaj.hazard.domain.TBusiRespPer;
import com.goldenwater.slaj.hazard.service.ITBusiRespPerService;

/**
 * 责任人
 */
@RestController
@RequestMapping("/hazard/tbusirespper")
public class TBusiRespPerController extends BaseController {
    @Autowired
    private ITBusiRespPerService tBusiRespPerService;

    @GetMapping("/list")
    public TableDataInfo list(TBusiRespPer tBusiRespPer) {
        startPage();
        List<TBusiRespPer> list = tBusiRespPerService.selectTBusiRespPerList(tBusiRespPer);
        return getDataTable(list);
    }

    @GetMapping("/{guid}")
    public AjaxResult getInfo(@PathVariable String guid) {
        return AjaxResult.success(tBusiRespPerService.selectTBusiRespPerByGuid(guid));
    }

    @PostMapping
    public AjaxResult add(@RequestBody TBusiRespPer tBusiRespPer) {
        return toAjax(tBusiRespPerService.insertTBusiRespPer(tBusiRespPer));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody TBusiRespPer tBusiRespPer) {
        return toAjax(tBusiRespPerService.updateTBusiRespPer(tBusiRespPer));
    }

    @DeleteMapping("/{guids}")
    public AjaxResult remove(@PathVariable String[] guids) {
        return toAjax(tBusiRespPerService.deleteTBusiRespPerByGuids(guids));
    }
}
