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

@RestController
@RequestMapping("/hidd/inve")
public class BisHiddInveController extends BaseController {
    @Autowired
    private IBisHiddInveService bisHiddInveService;

    @GetMapping("/list")
    public TableDataInfo list(BisHiddInve bisHiddInve) {
        startPage();
        List<BisHiddInve> list = bisHiddInveService.selectBisHiddInveList(bisHiddInve);
        return getDataTable(list);
    }

    @GetMapping("/{guid}")
    public AjaxResult getInfo(@PathVariable String guid) {
        return AjaxResult.success(bisHiddInveService.selectBisHiddInveByGuid(guid));
    }

    @PostMapping
    public AjaxResult add(@RequestBody BisHiddInve bisHiddInve) {
        return toAjax(bisHiddInveService.insertBisHiddInve(bisHiddInve));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisHiddInve bisHiddInve) {
        return toAjax(bisHiddInveService.updateBisHiddInve(bisHiddInve));
    }

    @DeleteMapping("/{guids}")
    public AjaxResult remove(@PathVariable String[] guids) {
        return toAjax(bisHiddInveService.deleteBisHiddInveByGuids(guids));
    }
}
