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

@RestController
@RequestMapping("/hidd/dict")
public class TDictHiddEngController extends BaseController {
    @Autowired
    private ITDictHiddEngService tDictHiddEngService;

    @GetMapping("/list")
    public TableDataInfo list(TDictHiddEng tDictHiddEng) {
        startPage();
        List<TDictHiddEng> list = tDictHiddEngService.selectTDictHiddEngList(tDictHiddEng);
        return getDataTable(list);
    }

    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable Long id) {
        return AjaxResult.success(tDictHiddEngService.selectTDictHiddEngById(id));
    }

    @PostMapping
    public AjaxResult add(@RequestBody TDictHiddEng tDictHiddEng) {
        return toAjax(tDictHiddEngService.insertTDictHiddEng(tDictHiddEng));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody TDictHiddEng tDictHiddEng) {
        return toAjax(tDictHiddEngService.updateTDictHiddEng(tDictHiddEng));
    }

    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(tDictHiddEngService.deleteTDictHiddEngByIds(ids));
    }
}
