package com.goldenwater.slaj.hidd.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.hidd.domain.BisHiddZeroAssessRec;
import com.goldenwater.slaj.hidd.service.IBisHiddZeroAssessRecService;

@RestController
@RequestMapping("/hidd/zeroassessrec")
public class BisHiddZeroAssessRecController extends BaseController {
    @Autowired
    private IBisHiddZeroAssessRecService bisHiddZeroAssessRecService;

    @GetMapping("/list")
    public TableDataInfo list(BisHiddZeroAssessRec bisHiddZeroAssessRec) {
        startPage();
        List<BisHiddZeroAssessRec> list = bisHiddZeroAssessRecService.selectBisHiddZeroAssessRecList(bisHiddZeroAssessRec);
        return getDataTable(list);
    }

    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable Long id) {
        return AjaxResult.success(bisHiddZeroAssessRecService.selectBisHiddZeroAssessRecById(id));
    }

    @PostMapping
    public AjaxResult add(@RequestBody BisHiddZeroAssessRec bisHiddZeroAssessRec) {
        return toAjax(bisHiddZeroAssessRecService.insertBisHiddZeroAssessRec(bisHiddZeroAssessRec));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisHiddZeroAssessRec bisHiddZeroAssessRec) {
        return toAjax(bisHiddZeroAssessRecService.updateBisHiddZeroAssessRec(bisHiddZeroAssessRec));
    }

    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(bisHiddZeroAssessRecService.deleteBisHiddZeroAssessRecByIds(ids));
    }
}
