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

@RestController
@RequestMapping("/hidd/monreprevo")
public class BisOrgMonRepRevoController extends BaseController {
    @Autowired
    private IBisOrgMonRepRevoService bisOrgMonRepRevoService;

    @GetMapping("/list")
    public TableDataInfo list(BisOrgMonRepRevo bisOrgMonRepRevo) {
        startPage();
        List<BisOrgMonRepRevo> list = bisOrgMonRepRevoService.selectBisOrgMonRepRevoList(bisOrgMonRepRevo);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody BisOrgMonRepRevo bisOrgMonRepRevo) {
        return toAjax(bisOrgMonRepRevoService.insertBisOrgMonRepRevo(bisOrgMonRepRevo));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisOrgMonRepRevo bisOrgMonRepRevo) {
        return toAjax(bisOrgMonRepRevoService.updateBisOrgMonRepRevo(bisOrgMonRepRevo));
    }

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