package com.ruoyi.frequency.userwithdrawalwaywi.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.frequency.userwithdrawalwaywi.entity.UserWithdrawalWayWi;
import com.ruoyi.frequency.userwithdrawalwaywi.service.UserWithdrawalWayWiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户提现方式(历史提现记录关联提现方式)Controller
 * 
 * @author liwenlong
 * @date 2023-07-20
 */
@RestController
@RequestMapping("/frequency/userwithdrawalwaywi")
public class UserWithdrawalWayWiController extends BaseController
{
    @Autowired
    private UserWithdrawalWayWiService userWithdrawalWayWiService;

    /**
     * 查询用户提现方式(历史提现记录关联提现方式)列表
     */
    @PreAuthorize("@ss.hasPermi('frequency:userwithdrawalwaywi:list')")
    @GetMapping("/list")
    public TableDataInfo list(UserWithdrawalWayWi userWithdrawalWayWi)
    {
        startPage();
        List<UserWithdrawalWayWi> list = userWithdrawalWayWiService.selectUserWithdrawalWayWiList(userWithdrawalWayWi);
        return getDataTable(list);
    }

    /**
     * 导出用户提现方式(历史提现记录关联提现方式)列表
     */
    @PreAuthorize("@ss.hasPermi('frequency:userwithdrawalwaywi:export')")
    @Log(title = "用户提现方式(历史提现记录关联提现方式)", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(UserWithdrawalWayWi userWithdrawalWayWi)
    {
        List<UserWithdrawalWayWi> list = userWithdrawalWayWiService.selectUserWithdrawalWayWiList(userWithdrawalWayWi);
        ExcelUtil<UserWithdrawalWayWi> util = new ExcelUtil<UserWithdrawalWayWi>(UserWithdrawalWayWi.class);
        return util.exportExcel(list, "用户提现方式(历史提现记录关联提现方式)数据");
    }

    /**
     * 获取用户提现方式(历史提现记录关联提现方式)详细信息
     */
    @PreAuthorize("@ss.hasPermi('frequency:userwithdrawalwaywi:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(userWithdrawalWayWiService.selectUserWithdrawalWayWiById(id));
    }

    /**
     * 新增用户提现方式(历史提现记录关联提现方式)
     */
    @PreAuthorize("@ss.hasPermi('frequency:userwithdrawalwaywi:add')")
    @Log(title = "用户提现方式(历史提现记录关联提现方式)", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody UserWithdrawalWayWi userWithdrawalWayWi)
    {
        return toAjax(userWithdrawalWayWiService.insertUserWithdrawalWayWi(userWithdrawalWayWi));
    }

    /**
     * 修改用户提现方式(历史提现记录关联提现方式)
     */
    @PreAuthorize("@ss.hasPermi('frequency:userwithdrawalwaywi:edit')")
    @Log(title = "用户提现方式(历史提现记录关联提现方式)", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody UserWithdrawalWayWi userWithdrawalWayWi)
    {
        return toAjax(userWithdrawalWayWiService.updateUserWithdrawalWayWi(userWithdrawalWayWi));
    }

    /**
     * 删除用户提现方式(历史提现记录关联提现方式)
     */
    @PreAuthorize("@ss.hasPermi('frequency:userwithdrawalwaywi:remove')")
    @Log(title = "用户提现方式(历史提现记录关联提现方式)", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(userWithdrawalWayWiService.deleteUserWithdrawalWayWiByIds(ids));
    }
}
