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

@RestController
@RequestMapping("/hidd/rectprog")
public class BisHiddRectProgController extends BaseController {
    @Autowired
    private IBisHiddRectProgService bisHiddRectProgService;

    @GetMapping("/list")
    public TableDataInfo list(BisHiddRectProg bisHiddRectProg) {
        startPage();
        List<BisHiddRectProg> list = bisHiddRectProgService.selectBisHiddRectProgList(bisHiddRectProg);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody BisHiddRectProg bisHiddRectProg) {
        return toAjax(bisHiddRectProgService.insertBisHiddRectProg(bisHiddRectProg));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisHiddRectProg bisHiddRectProg) {
        return toAjax(bisHiddRectProgService.updateBisHiddRectProg(bisHiddRectProg));
    }

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