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.BisHiddAssessRec;
import com.goldenwater.slaj.hidd.service.IBisHiddAssessRecService;

@RestController
@RequestMapping("/hidd/assessrec")
public class BisHiddAssessRecController extends BaseController {
    @Autowired
    private IBisHiddAssessRecService bisHiddAssessRecService;

    @GetMapping("/list")
    public TableDataInfo list(BisHiddAssessRec bisHiddAssessRec) {
        startPage();
        List<BisHiddAssessRec> list = bisHiddAssessRecService.selectBisHiddAssessRecList(bisHiddAssessRec);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody BisHiddAssessRec bisHiddAssessRec) {
        return toAjax(bisHiddAssessRecService.insertBisHiddAssessRec(bisHiddAssessRec));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisHiddAssessRec bisHiddAssessRec) {
        return toAjax(bisHiddAssessRecService.updateBisHiddAssessRec(bisHiddAssessRec));
    }

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