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

@RestController
@RequestMapping("/hidd/eva")
public class TBusiHiddEvaController extends BaseController {
    @Autowired
    private ITBusiHiddEvaService tBusiHiddEvaService;

    @GetMapping("/list")
    public TableDataInfo list(TBusiHiddEva tBusiHiddEva) {
        startPage();
        List<TBusiHiddEva> list = tBusiHiddEvaService.selectTBusiHiddEvaList(tBusiHiddEva);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody TBusiHiddEva tBusiHiddEva) {
        return toAjax(tBusiHiddEvaService.insertTBusiHiddEva(tBusiHiddEva));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody TBusiHiddEva tBusiHiddEva) {
        return toAjax(tBusiHiddEvaService.updateTBusiHiddEva(tBusiHiddEva));
    }

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