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

@RestController
@RequestMapping("/hidd/recrep")
public class BisHiddRecRepController extends BaseController {
    @Autowired
    private IBisHiddRecRepService bisHiddRecRepService;

    @GetMapping("/list")
    public TableDataInfo list(BisHiddRecRep bisHiddRecRep) {
        startPage();
        List<BisHiddRecRep> list = bisHiddRecRepService.selectBisHiddRecRepList(bisHiddRecRep);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody BisHiddRecRep bisHiddRecRep) {
        return toAjax(bisHiddRecRepService.insertBisHiddRecRep(bisHiddRecRep));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisHiddRecRep bisHiddRecRep) {
        return toAjax(bisHiddRecRepService.updateBisHiddRecRep(bisHiddRecRep));
    }

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