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

@RestController
@RequestMapping("/hidd/majhiddsup")
public class BisMajHiddSupController extends BaseController {
    @Autowired
    private IBisMajHiddSupService bisMajHiddSupService;

    @GetMapping("/list")
    public TableDataInfo list(BisMajHiddSup bisMajHiddSup) {
        startPage();
        List<BisMajHiddSup> list = bisMajHiddSupService.selectBisMajHiddSupList(bisMajHiddSup);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody BisMajHiddSup bisMajHiddSup) {
        return toAjax(bisMajHiddSupService.insertBisMajHiddSup(bisMajHiddSup));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody BisMajHiddSup bisMajHiddSup) {
        return toAjax(bisMajHiddSupService.updateBisMajHiddSup(bisMajHiddSup));
    }

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