package com.ruoyi.web.controller.system;

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.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.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.WyPlatformFeatureBeer;
import com.ruoyi.system.service.IWyPlatformFeatureBeerService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 专题页酒款Controller
 * 
 * @author ruoyi
 * @date 2025-01-06
 */
//@RestController
//@RequestMapping("/system/PlatformFeatureBeer")
public class WyPlatformFeatureBeerController extends BaseController
{
    @Autowired
    private IWyPlatformFeatureBeerService wyPlatformFeatureBeerService;

    /**
     * 查询专题页酒款列表
     */
    @PreAuthorize("@ss.hasPermi('system:PlatformFeatureBeer:list')")
    @GetMapping("/list")
    public TableDataInfo list(WyPlatformFeatureBeer wyPlatformFeatureBeer)
    {
        startPage();
        List<WyPlatformFeatureBeer> list = wyPlatformFeatureBeerService.selectWyPlatformFeatureBeerList(wyPlatformFeatureBeer);
        return getDataTable(list);
    }

    /**
     * 导出专题页酒款列表
     */
    @PreAuthorize("@ss.hasPermi('system:PlatformFeatureBeer:export')")
    @Log(title = "专题页酒款", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, WyPlatformFeatureBeer wyPlatformFeatureBeer)
    {
        List<WyPlatformFeatureBeer> list = wyPlatformFeatureBeerService.selectWyPlatformFeatureBeerList(wyPlatformFeatureBeer);
        ExcelUtil<WyPlatformFeatureBeer> util = new ExcelUtil<WyPlatformFeatureBeer>(WyPlatformFeatureBeer.class);
        util.exportExcel(response, list, "专题页酒款数据");
    }

    /**
     * 获取专题页酒款详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:PlatformFeatureBeer:query')")
    @GetMapping(value = "/{pageId}")
    public AjaxResult getInfo(@PathVariable("pageId") Long pageId)
    {
        return success(wyPlatformFeatureBeerService.selectWyPlatformFeatureBeerByPageId(pageId));
    }

    /**
     * 新增专题页酒款
     */
    @PreAuthorize("@ss.hasPermi('system:PlatformFeatureBeer:add')")
    @Log(title = "专题页酒款", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody WyPlatformFeatureBeer wyPlatformFeatureBeer)
    {
        return toAjax(wyPlatformFeatureBeerService.insertWyPlatformFeatureBeer(wyPlatformFeatureBeer));
    }

    /**
     * 修改专题页酒款
     */
    @PreAuthorize("@ss.hasPermi('system:PlatformFeatureBeer:edit')")
    @Log(title = "专题页酒款", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody WyPlatformFeatureBeer wyPlatformFeatureBeer)
    {
        return toAjax(wyPlatformFeatureBeerService.updateWyPlatformFeatureBeer(wyPlatformFeatureBeer));
    }

    /**
     * 删除专题页酒款
     */
    @PreAuthorize("@ss.hasPermi('system:PlatformFeatureBeer:remove')")
    @Log(title = "专题页酒款", businessType = BusinessType.DELETE)
	@DeleteMapping("/{pageIds}")
    public AjaxResult remove(@PathVariable Long[] pageIds)
    {
        return toAjax(wyPlatformFeatureBeerService.deleteWyPlatformFeatureBeerByPageIds(pageIds));
    }
}
