package com.ruoyi.web.controller.doumu;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.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.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.DoumuProductFj;
import com.ruoyi.system.service.IDoumuProductFjService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 痘姆古陶_附件Controller
 * 
 * @author boman
 * @date 2024-01-16
 */
@RestController
@RequestMapping("/system/fi")
public class DoumuProductFjController extends BaseController
{
    @Autowired
    private IDoumuProductFjService DoumuProductFjService;

    /**
     * 查询痘姆古陶_附件列表
     */
    @PreAuthorize("@ss.hasPermi('system:fi:list')")
    @GetMapping("/list")
    public TableDataInfo list(DoumuProductFj doumuProductFj)
    {
        startPage();
        List<DoumuProductFj> list = DoumuProductFjService.selectDoumuProductFjList(doumuProductFj);
        return getDataTable(list);
    }

    /**
     * 导出痘姆古陶_附件列表
     */
    @PreAuthorize("@ss.hasPermi('system:fi:export')")
    @Log(title = "痘姆古陶_附件", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DoumuProductFj doumuProductFj)
    {
        List<DoumuProductFj> list = DoumuProductFjService.selectDoumuProductFjList(doumuProductFj);
        ExcelUtil<DoumuProductFj> util = new ExcelUtil<DoumuProductFj>(DoumuProductFj.class);
        util.exportExcel(response, list, "痘姆古陶_附件数据");
    }

    /**
     * 获取痘姆古陶_附件详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:fi:query')")
    @GetMapping(value = "/{fiId}")
    public AjaxResult getInfo(@PathVariable("fiId") Long fiId)
    {
        return success(DoumuProductFjService.selectDoumuProductFjByFiId(fiId));
    }

    /**
     * 新增痘姆古陶_附件
     */
    @PreAuthorize("@ss.hasPermi('system:fi:add')")
    @Log(title = "痘姆古陶_附件", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DoumuProductFj doumuProductFj)
    {
        return toAjax(DoumuProductFjService.insertDoumuProductFj(doumuProductFj));
    }

    /**
     * 修改痘姆古陶_附件
     */
    @PreAuthorize("@ss.hasPermi('system:fi:edit')")
    @Log(title = "痘姆古陶_附件", businessType = BusinessType.UPDATE)
    @PostMapping("/put")
    public AjaxResult edit(@RequestBody DoumuProductFj doumuProductFj)
    {
        return toAjax(DoumuProductFjService.updateDoumuProductFj(doumuProductFj));
    }

    /**
     * 删除痘姆古陶_附件
     */
    @PreAuthorize("@ss.hasPermi('system:fi:remove')")
    @Log(title = "痘姆古陶_附件", businessType = BusinessType.DELETE)
	@GetMapping("/delete/{fiIds}")
    public AjaxResult remove(@PathVariable Long[] fiIds)
    {
        return toAjax(DoumuProductFjService.deleteDoumuProductFjByFiIds(fiIds));
    }
}
