package com.limap.controller.manager;

import com.limap.common.core.controller.BaseController;
import com.limap.common.core.domain.AjaxResult;
import com.limap.common.core.domain.entity.SysRole;
import com.limap.common.core.page.TableDataInfo;
import com.limap.common.enums.BusinessType;
import com.limap.common.log.annotation.Log;
import com.limap.common.utils.poi.ExcelUtil;
import com.limap.core.basic.domain.BasicUserWithdraw;
import com.limap.core.basic.domain.SysCellNumber;
import com.limap.core.basic.service.IBasicUserWithdrawService;
import com.limap.core.basic.service.ISysCellNumberService;
import com.limap.core.basic.vo.BasicUserWithdrawVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

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

/**
 * 语音报警电话Controller
 *
 * @author jjb
 * @date 2025-04-11
 */
@Api(tags = "语音报警电话")
@RestController
@RequestMapping("/sys/tel")
public class SysCellNumberController extends BaseController {
    @Autowired
    private ISysCellNumberService cellNumberService;

    /**
     * 查询提现记录列表
     */
    @ApiOperation("查询提现记录列表")
    @GetMapping("/list")
    public AjaxResult list(SysCellNumber cellNumber) {
        List<SysCellNumber> list = cellNumberService.list();
        return success(list);
    }


    /**
     * 新增提现记录
     */
    @ApiOperation("新增提现记录")
    @Log(title = "提现记录", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SysCellNumber cellNumber) {
        return toAjax(cellNumberService.save(cellNumber));
    }

    /**
     * 修改提现记录
     */
    @ApiOperation("修改提现记录")
    @Log(title = "提现记录", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysCellNumber cellNumber) {
        return toAjax(cellNumberService.updateById(cellNumber));
    }

    /**
     * 删除提现记录
     */
    @ApiOperation("删除提现记录")
    @Log(title = "提现记录", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(cellNumberService.removeByIds(Arrays.asList(ids)));
    }
}
