package com.fs.qw.controller;

import java.util.List;

import com.fs.qw.param.IPadServerUserParam;
import com.fs.qw.vo.QwIPadServerUserVO;
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.fs.common.annotation.Log;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.enums.BusinessType;
import com.fs.qw.domain.QwIpadServerUser;
import com.fs.qw.service.IQwIpadServerUserService;
import com.fs.common.utils.poi.ExcelUtil;
import com.fs.common.core.page.TableDataInfo;

/**
 * ipad用户Controller
 *
 * @author fs
 * @date 2025-07-23
 */
@RestController
@RequestMapping("/qw/qwIpadServerUser")
public class QwIpadServerUserController extends BaseController
{
    @Autowired
    private IQwIpadServerUserService qwIpadServerUserService;

    /**
     * 查询ipad用户列表
     */
    @PreAuthorize("@ss.hasPermi('qw:qwIpadServerUser:list')")
    @GetMapping("/list")
    public TableDataInfo list(QwIpadServerUser qwIpadServerUser)
    {
        startPage();
        List<QwIpadServerUser> list = qwIpadServerUserService.selectQwIpadServerUserList(qwIpadServerUser);
        return getDataTable(list);
    }

    /**
     * 查询ipad用户列表
     */
    @PreAuthorize("@ss.hasPermi('qw:qwIpadServerUser:list')")
    @GetMapping("/ipadServerUserList")
    public TableDataInfo list(IPadServerUserParam iPadServerUserParam)
    {
        startPage();
        List<QwIPadServerUserVO> list = qwIpadServerUserService.selectIpadServerUserList(iPadServerUserParam);
        return getDataTable(list);
    }

    /**
     * 导出ipad用户列表
     */
    @PreAuthorize("@ss.hasPermi('qw:qwIpadServerUser:export')")
    @Log(title = "ipad用户", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(IPadServerUserParam iPadServerUserParam)
    {
        List<QwIPadServerUserVO> list = qwIpadServerUserService.selectIpadServerUserList(iPadServerUserParam);
        ExcelUtil<QwIPadServerUserVO> util = new ExcelUtil<QwIPadServerUserVO>(QwIPadServerUserVO.class);
        return util.exportExcel(list, "ipad用户数据");
    }

    /**
     * 获取ipad用户详细信息
     */
    @PreAuthorize("@ss.hasPermi('qw:qwIpadServerUser:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(qwIpadServerUserService.selectQwIpadServerUserById(id));
    }

    /**
     * 新增ipad用户
     */
    @PreAuthorize("@ss.hasPermi('qw:qwIpadServerUser:add')")
    @Log(title = "ipad用户", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody QwIpadServerUser qwIpadServerUser)
    {
        return toAjax(qwIpadServerUserService.insertQwIpadServerUser(qwIpadServerUser));
    }

    /**
     * 修改ipad用户
     */
    @PreAuthorize("@ss.hasPermi('qw:qwIpadServerUser:edit')")
    @Log(title = "ipad用户", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody QwIpadServerUser qwIpadServerUser)
    {
        return toAjax(qwIpadServerUserService.updateQwIpadServerUser(qwIpadServerUser));
    }

    /**
     * 删除ipad用户
     */
    @PreAuthorize("@ss.hasPermi('qw:qwIpadServerUser:remove')")
    @Log(title = "ipad用户", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(qwIpadServerUserService.deleteQwIpadServerUserByIds(ids));
    }
}
