package com.sckw.payment.controller.operate;

import com.sckw.core.web.response.HttpResult;
import com.sckw.payment.model.vo.req.CashPageReq;
import com.sckw.payment.model.vo.req.WalletDetailReq;
import com.sckw.payment.model.vo.req.page.PrePayPage;
import com.sckw.payment.service.WalletService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 钱包
 *
 * @author xucaiqin
 * @date 2023-08-28 15:36:48
 */
@Tag(name = "运营钱包管理", description = "提供运营端钱包相关操作接口")
@Validated
@RestController
@RequestMapping("/operateWallet")
@Slf4j
public class OperateWalletController {
    @Resource
    private WalletService walletService;


    /**
     * 查询资金明细
     *
     * @param walletDetailReq 查询参数
     * @return 资金明细列表
     */
    @Operation(summary = "资金明细", description = "查询钱包资金明细")
    @GetMapping("detail")
    public HttpResult detail(WalletDetailReq walletDetailReq) {
        return HttpResult.ok(walletService.walletDetail2(walletDetailReq));
    }


    /**
     * 提现记录
     *
     * @param cashPageReq 查询参数
     * @return 提现记录列表
     */
    @Operation(summary = "提现记录", description = "查询提现记录列表")
    @GetMapping("cashList")
    public HttpResult cashList(CashPageReq cashPageReq) {
        return HttpResult.ok(walletService.cashList2(cashPageReq));
    }


    /**
     * 提现记录 分类统计
     *
     * @param cashPageReq 查询参数
     * @return 统计结果
     */
    @Operation(summary = "提现记录统计", description = "提现记录分类统计")
    @GetMapping("cashCount")
    public HttpResult cashCount(CashPageReq cashPageReq) {
        return HttpResult.ok(walletService.cashCount2(cashPageReq));
    }

    /**
     * 预付列表
     *
     * @param prePayPage 查询参数
     * @return 预付列表
     */
    @Operation(summary = "预付列表", description = "查询预付列表")
    @GetMapping("prePayList")
    public HttpResult prePayList(PrePayPage prePayPage) {
        return HttpResult.ok(walletService.prePayList2(prePayPage));
    }

}