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

@RestController
@RequestMapping("/hidd/count")
public class TBusiHiddCountController extends BaseController {
    @Autowired
    private ITBusiHiddCountService tBusiHiddCountService;

    @GetMapping("/list")
    public TableDataInfo list(TBusiHiddCount tBusiHiddCount) {
        startPage();
        List<TBusiHiddCount> list = tBusiHiddCountService.selectTBusiHiddCountList(tBusiHiddCount);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody TBusiHiddCount tBusiHiddCount) {
        return toAjax(tBusiHiddCountService.insertTBusiHiddCount(tBusiHiddCount));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody TBusiHiddCount tBusiHiddCount) {
        return toAjax(tBusiHiddCountService.updateTBusiHiddCount(tBusiHiddCount));
    }

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