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

@RestController
@RequestMapping("/hidd/countmon")
public class TBusiHiddCountMonController extends BaseController {
    @Autowired
    private ITBusiHiddCountMonService tBusiHiddCountMonService;

    @GetMapping("/list")
    public TableDataInfo list(TBusiHiddCountMon tBusiHiddCountMon) {
        startPage();
        List<TBusiHiddCountMon> list = tBusiHiddCountMonService.selectTBusiHiddCountMonList(tBusiHiddCountMon);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody TBusiHiddCountMon tBusiHiddCountMon) {
        return toAjax(tBusiHiddCountMonService.insertTBusiHiddCountMon(tBusiHiddCountMon));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody TBusiHiddCountMon tBusiHiddCountMon) {
        return toAjax(tBusiHiddCountMonService.updateTBusiHiddCountMon(tBusiHiddCountMon));
    }

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