package com.ruoyi.project.production.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.production.domain.TPpeCmldefLocker;
import com.ruoyi.project.production.service.ITPpeCmldefLockerService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;

/**
 * 自行车棚防化靴/防化服柜子Controller
 *
 * @author ssy
 * @date 2023-11-30
 */
@RestController
@RequestMapping("/production/cmldefLocker")
public class TPpeCmldefLockerController extends BaseController
{
    @Autowired
    private ITPpeCmldefLockerService tPpeCmldefLockerService;

    /**
     * 查询自行车棚防化靴/防化服柜子列表
     */

    @GetMapping("/list")
    public TableDataInfo list(TPpeCmldefLocker tPpeCmldefLocker)
    {
        startPage();
        List<TPpeCmldefLocker> list = tPpeCmldefLockerService.selectTPpeCmldefLockerList(tPpeCmldefLocker);
        return getDataTable(list);
    }

    /**
     * 导出自行车棚防化靴/防化服柜子列表
     */

    @Log(title = "自行车棚防化靴/防化服柜子", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(TPpeCmldefLocker tPpeCmldefLocker)
    {
        List<TPpeCmldefLocker> list = tPpeCmldefLockerService.selectTPpeCmldefLockerList(tPpeCmldefLocker);
        ExcelUtil<TPpeCmldefLocker> util = new ExcelUtil<TPpeCmldefLocker>(TPpeCmldefLocker.class);
        return util.exportExcel(list, "cmldefLocker");
    }

    /**
     * 获取自行车棚防化靴/防化服柜子详细信息
     */

    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(tPpeCmldefLockerService.selectTPpeCmldefLockerById(id));
    }

    /**
     * 新增自行车棚防化靴/防化服柜子
     */

    @Log(title = "自行车棚防化靴/防化服柜子", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TPpeCmldefLocker tPpeCmldefLocker)
    {
        return toAjax(tPpeCmldefLockerService.insertTPpeCmldefLocker(tPpeCmldefLocker));
    }

    /**
     * 修改自行车棚防化靴/防化服柜子
     */

    @Log(title = "自行车棚防化靴/防化服柜子", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TPpeCmldefLocker tPpeCmldefLocker)
    {
        return toAjax(tPpeCmldefLockerService.updateTPpeCmldefLocker(tPpeCmldefLocker));
    }

    /**
     * 删除自行车棚防化靴/防化服柜子
     */

    @Log(title = "自行车棚防化靴/防化服柜子", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tPpeCmldefLockerService.deleteTPpeCmldefLockerByIds(ids));
    }
}
