package com.ruoyi.web.v3.controller;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.v3.entity.HbRiskCheckLedgerEntity;
import com.ruoyi.web.v3.model.request.HbRiskCheckLedgerPageReq;
import com.ruoyi.web.v3.service.IHbRiskCheckLedgerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 * v3.0 隐患排查治理台账 前端控制器
 * </p>
 *
 */
@RestController
@RequestMapping("/v3/hb_risk_check_ledger")
@Api("3.0 隐患排查治理台账")
public class HbRiskCheckLedgerController {

    @Resource
    private IHbRiskCheckLedgerService riskCheckService;

    @ApiOperation("隐患排查治理台账记录添加")
    @PostMapping("/add")
    public AjaxResult add(@RequestBody HbRiskCheckLedgerEntity request){
        return riskCheckService.add(request);
    }

    @ApiOperation("隐患排查治理台账记录修改")
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody HbRiskCheckLedgerEntity request){
        return riskCheckService.edit(request);
    }

    @ApiOperation("隐患排查治理台账记录删除")
    @PostMapping("/delete")
    public AjaxResult delete(@RequestBody Map<String, String> paramsMap) {
        String ids = paramsMap.get("ids");
        return riskCheckService.delete(ids);
    }

    @ApiOperation("隐患排查治理台账记录分页查询")
    @GetMapping("/page")
    public AjaxResult page(@ModelAttribute HbRiskCheckLedgerPageReq request) {
        return riskCheckService.page(request);
    }


    @ApiOperation("隐患排查治理台账记录列表全量查询")
    @GetMapping("/list")
    public AjaxResult listAll(){
        return riskCheckService.listAll();
    }

}
