package com.ruoyi.frequency.klkwithdrawalrecord.controller;

import java.util.List;
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.frequency.klkwithdrawalrecord.entity.KlkWithdrawalRecord;
import com.ruoyi.frequency.klkwithdrawalrecord.service.KlkWithdrawalRecordService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 卡拉卡平台提现记录Controller
 * 
 * @author liwenlong
 * @date 2024-05-07
 */
@RestController
@RequestMapping("/frequency/klkwithdrawalrecord")
public class KlkWithdrawalRecordController extends BaseController
{
    @Autowired
    private KlkWithdrawalRecordService klkWithdrawalRecordService;

    /**
     * 查询卡拉卡平台提现记录列表
     */
    @PreAuthorize("@ss.hasPermi('frequency:klkwithdrawalrecord:list')")
    @GetMapping("/list")
    public TableDataInfo<KlkWithdrawalRecord> list(KlkWithdrawalRecord klkWithdrawalRecord)
    {
        startPage();
        List<KlkWithdrawalRecord> list = klkWithdrawalRecordService.selectKlkWithdrawalRecordList(klkWithdrawalRecord);
        return getDataTable(list);
    }

    /**
     * 导出卡拉卡平台提现记录列表
     */
    @PreAuthorize("@ss.hasPermi('frequency:klkwithdrawalrecord:export')")
    @Log(title = "卡拉卡平台提现记录", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(KlkWithdrawalRecord klkWithdrawalRecord)
    {
        List<KlkWithdrawalRecord> list = klkWithdrawalRecordService.selectKlkWithdrawalRecordList(klkWithdrawalRecord);
        ExcelUtil<KlkWithdrawalRecord> util = new ExcelUtil<KlkWithdrawalRecord>(KlkWithdrawalRecord.class);
        return util.exportExcel(list, "卡拉卡平台提现记录数据");
    }

    /**
     * 获取卡拉卡平台提现记录详细信息
     */
    @PreAuthorize("@ss.hasPermi('frequency:klkwithdrawalrecord:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult<KlkWithdrawalRecord> getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(klkWithdrawalRecordService.selectKlkWithdrawalRecordById(id));
    }

    /**
     * 新增卡拉卡平台提现记录
     */
    @PreAuthorize("@ss.hasPermi('frequency:klkwithdrawalrecord:add')")
    @Log(title = "卡拉卡平台提现记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody KlkWithdrawalRecord klkWithdrawalRecord)
    {
        return toAjax(klkWithdrawalRecordService.insertKlkWithdrawalRecord(klkWithdrawalRecord));
    }

    /**
     * 修改卡拉卡平台提现记录
     */
    @PreAuthorize("@ss.hasPermi('frequency:klkwithdrawalrecord:edit')")
    @Log(title = "卡拉卡平台提现记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody KlkWithdrawalRecord klkWithdrawalRecord)
    {
        return toAjax(klkWithdrawalRecordService.updateKlkWithdrawalRecord(klkWithdrawalRecord));
    }

    /**
     * 删除卡拉卡平台提现记录
     */
    @PreAuthorize("@ss.hasPermi('frequency:klkwithdrawalrecord:remove')")
    @Log(title = "卡拉卡平台提现记录", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}/{delFlag}")
    public AjaxResult remove(@PathVariable("ids") Long[] ids,@PathVariable("delFlag") Integer delFlag)
    {
        return toAjax(klkWithdrawalRecordService.deleteKlkWithdrawalRecordByIds(ids,delFlag));
    }
}
