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

@RestController
@RequestMapping("/hidd/rectacce")
public class BisHiddRectAcceController extends BaseController {
    @Autowired
    private IBisHiddRectAcceService bisHiddRectAcceService;

    @GetMapping("/list")
    public TableDataInfo list(BisHiddRectAcce bisHiddRectAcce) {
        startPage();
        List<BisHiddRectAcce> list = bisHiddRectAcceService.selectBisHiddRectAcceList(bisHiddRectAcce);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody BisHiddRectAcce bisHiddRectAcce) {
        return toAjax(bisHiddRectAcceService.insertBisHiddRectAcce(bisHiddRectAcce));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisHiddRectAcce bisHiddRectAcce) {
        return toAjax(bisHiddRectAcceService.updateBisHiddRectAcce(bisHiddRectAcce));
    }

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