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

@RestController
@RequestMapping("/hidd/monrepperi")
public class BisOrgMonRepPeriController extends BaseController {
    @Autowired
    private IBisOrgMonRepPeriService bisOrgMonRepPeriService;

    @GetMapping("/list")
    public TableDataInfo list(BisOrgMonRepPeri bisOrgMonRepPeri) {
        startPage();
        List<BisOrgMonRepPeri> list = bisOrgMonRepPeriService.selectBisOrgMonRepPeriList(bisOrgMonRepPeri);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody BisOrgMonRepPeri bisOrgMonRepPeri) {
        return toAjax(bisOrgMonRepPeriService.insertBisOrgMonRepPeri(bisOrgMonRepPeri));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisOrgMonRepPeri bisOrgMonRepPeri) {
        return toAjax(bisOrgMonRepPeriService.updateBisOrgMonRepPeri(bisOrgMonRepPeri));
    }

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