package com.ruoyi.web.v3.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.v3.entity.HbRiskStrategyDictionaryEntity;
import com.ruoyi.web.v3.model.request.HbRiskStrategyDictionaryPageReq;
import com.ruoyi.web.v3.service.IHbRiskStrategyDictionaryService;
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_strategy_dictionary")
@Api("3.0隐患排查字典管理")
public class HbRiskStrategyDictionaryController {

    @Resource
    private IHbRiskStrategyDictionaryService checkAsfService;

    @ApiOperation("隐患排查字典记录添加")
    @PostMapping("/add")
    public AjaxResult add(@RequestBody HbRiskStrategyDictionaryEntity request){
        return checkAsfService.add(request);
    }

    @ApiOperation("隐患排查字典记录修改")
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody HbRiskStrategyDictionaryEntity request){
        return checkAsfService.edit(request);
    }

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

    @ApiOperation("隐患排查字典记录分页查询")
    @GetMapping("/page")
    public AjaxResult page(@ModelAttribute HbRiskStrategyDictionaryPageReq request) {
        return checkAsfService.page(request);
    }


    @ApiOperation("隐患排查字典录列表全量查询")
    @GetMapping("/list")
    public AjaxResult listAll(){
        return checkAsfService.listAll();
    }

}
