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

@RestController
@RequestMapping("/hidd/assess")
public class BisHiddAssessController extends BaseController {
    @Autowired
    private IBisHiddAssessService bisHiddAssessService;

    @GetMapping("/list")
    public TableDataInfo list(BisHiddAssess bisHiddAssess) {
        startPage();
        List<BisHiddAssess> list = bisHiddAssessService.selectBisHiddAssessList(bisHiddAssess);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody BisHiddAssess bisHiddAssess) {
        return toAjax(bisHiddAssessService.insertBisHiddAssess(bisHiddAssess));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisHiddAssess bisHiddAssess) {
        return toAjax(bisHiddAssessService.updateBisHiddAssess(bisHiddAssess));
    }

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