package com.game.business.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.game.business.domain.AppGameClassify;
import com.game.business.service.IAppGameClassifyService;
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.game.common.annotation.Log;
import com.game.common.core.controller.BaseController;
import com.game.common.core.domain.AjaxResult;
import com.game.common.enums.BusinessType;
import com.game.common.annotation.DataSource;
import com.game.common.enums.DataSourceType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.game.common.utils.poi.ExcelUtil;
import com.game.common.core.page.TableDataInfo;

/**
 * 【请填写功能名称】Controller
 * 
 * @author game
 * @date 2024-06-14
 */
@RestController
@RequestMapping("/system/classify")
@DataSource(DataSourceType.SLAVE)
@Api(value = "AppGameClassifyController", description = "【请填写功能名称】接口", tags = {"【请填写功能名称】"})
public class AppGameClassifyController extends BaseController
{
    @Autowired
    private IAppGameClassifyService appGameClassifyService;

    /**
     * 查询【请填写功能名称】列表
     */
    @PreAuthorize("@ss.hasPermi('system:classify:list')")
    @GetMapping("/list")
    @ApiOperation(value = "查询【请填写功能名称】列表", notes = "获取【请填写功能名称】列表")
    public TableDataInfo list(AppGameClassify appGameClassify)
    {
        startPage();
        List<AppGameClassify> list = appGameClassifyService.selectAppGameClassifyList(appGameClassify);
        return getDataTable(list);
    }

    /**
     * 导出【请填写功能名称】列表
     */
    @PreAuthorize("@ss.hasPermi('system:classify:export')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ApiOperation(value = "导出【请填写功能名称】列表", notes = "导出【请填写功能名称】列表")
    public void export(HttpServletResponse response, AppGameClassify appGameClassify)
    {
        List<AppGameClassify> list = appGameClassifyService.selectAppGameClassifyList(appGameClassify);
        ExcelUtil<AppGameClassify> util = new ExcelUtil<AppGameClassify>(AppGameClassify.class);
        util.exportExcel(response, list, "【请填写功能名称】数据");
    }

    /**
     * 获取【请填写功能名称】详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:classify:query')")
    @GetMapping(value = "/{id}")
    @ApiOperation(value = "获取【请填写功能名称】详细信息", notes = "获取【请填写功能名称】详细信息")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(appGameClassifyService.selectAppGameClassifyById(id));
    }

    /**
     * 新增【请填写功能名称】
     */
    @PreAuthorize("@ss.hasPermi('system:classify:add')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
    @ApiOperation(value = "新增【请填写功能名称】", notes = "新增【请填写功能名称】")
    @PostMapping
    public AjaxResult add(@RequestBody AppGameClassify appGameClassify)
    {
        return toAjax(appGameClassifyService.insertAppGameClassify(appGameClassify));
    }

    /**
     * 修改【请填写功能名称】
     */
    @PreAuthorize("@ss.hasPermi('system:classify:edit')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @ApiOperation(value = "修改【请填写功能名称】", notes = "修改【请填写功能名称】")
    @PutMapping
    public AjaxResult edit(@RequestBody AppGameClassify appGameClassify)
    {
        return toAjax(appGameClassifyService.updateAppGameClassify(appGameClassify));
    }

    /**
     * 删除【请填写功能名称】
     */
    @PreAuthorize("@ss.hasPermi('system:classify:remove')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
    @ApiOperation(value = "删除【请填写功能名称】", notes = "删除【请填写功能名称】")
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(appGameClassifyService.deleteAppGameClassifyByIds(ids));
    }
}
