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

/**
 * 工程信息
 */
@RestController
@RequestMapping("/hidd/objeng")
public class ObjEngController extends BaseController {
    @Autowired
    private IObjEngService objEngService;

    @GetMapping("/list")
    public TableDataInfo list(ObjEng objEng) {
        startPage();
        List<ObjEng> list = objEngService.selectObjEngList(objEng);
        return getDataTable(list);
    }

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

    @PostMapping
    public AjaxResult add(@RequestBody ObjEng objEng) {
        return toAjax(objEngService.insertObjEng(objEng));
    }

    @PutMapping
    public AjaxResult edit(@RequestBody ObjEng objEng) {
        return toAjax(objEngService.updateObjEng(objEng));
    }

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