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

@RestController
@RequestMapping("/hidd/threva")
public class TBusiHiddThrEvaController extends BaseController {
    @Autowired
    private ITBusiHiddThrEvaService tBusiHiddThrEvaService;

    @GetMapping("/list")
    public TableDataInfo list(TBusiHiddThrEva tBusiHiddThrEva) {
        startPage();
        List<TBusiHiddThrEva> list = tBusiHiddThrEvaService.selectTBusiHiddThrEvaList(tBusiHiddThrEva);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody TBusiHiddThrEva tBusiHiddThrEva) {
        return toAjax(tBusiHiddThrEvaService.insertTBusiHiddThrEva(tBusiHiddThrEva));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody TBusiHiddThrEva tBusiHiddThrEva) {
        return toAjax(tBusiHiddThrEvaService.updateTBusiHiddThrEva(tBusiHiddThrEva));
    }

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