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

@RestController
@RequestMapping("/hidd/rectimpl")
public class BisHiddRectImplController extends BaseController {
    @Autowired
    private IBisHiddRectImplService bisHiddRectImplService;

    @GetMapping("/list")
    public TableDataInfo list(BisHiddRectImpl bisHiddRectImpl) {
        startPage();
        List<BisHiddRectImpl> list = bisHiddRectImplService.selectBisHiddRectImplList(bisHiddRectImpl);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody BisHiddRectImpl bisHiddRectImpl) {
        return toAjax(bisHiddRectImplService.insertBisHiddRectImpl(bisHiddRectImpl));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisHiddRectImpl bisHiddRectImpl) {
        return toAjax(bisHiddRectImplService.updateBisHiddRectImpl(bisHiddRectImpl));
    }

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