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

@RestController
@RequestMapping("/hidd/majveri")
public class BisHiddMajVeriController extends BaseController {
    @Autowired
    private IBisHiddMajVeriService bisHiddMajVeriService;

    @GetMapping("/list")
    public TableDataInfo list(BisHiddMajVeri bisHiddMajVeri) {
        startPage();
        List<BisHiddMajVeri> list = bisHiddMajVeriService.selectBisHiddMajVeriList(bisHiddMajVeri);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody BisHiddMajVeri bisHiddMajVeri) {
        return toAjax(bisHiddMajVeriService.insertBisHiddMajVeri(bisHiddMajVeri));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisHiddMajVeri bisHiddMajVeri) {
        return toAjax(bisHiddMajVeriService.updateBisHiddMajVeri(bisHiddMajVeri));
    }

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