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 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
 */
@Validated
@RestController
@RequestMapping("/operateWallet")
@Slf4j
public class OperateWalletController {
    @Resource
    private WalletService walletService;


    /**
     * 查询资金明细
     *
     * @return
     */
    @GetMapping("detail")
    public HttpResult detail(WalletDetailReq walletDetailReq) {
        return HttpResult.ok(walletService.walletDetail2(walletDetailReq));
    }


    /**
     * 提现记录
     *
     * @param cashPageReq
     * @return
     */
    @GetMapping("cashList")
    public HttpResult cashList(CashPageReq cashPageReq) {
        return HttpResult.ok(walletService.cashList2(cashPageReq));
    }


    /**
     * 提现记录 分类统计
     *
     * @param cashPageReq
     * @return
     */
    @GetMapping("cashCount")
    public HttpResult cashCount(CashPageReq cashPageReq) {
        return HttpResult.ok(walletService.cashCount2(cashPageReq));
    }

    /**
     * 预付列表
     *
     * @param prePayPage
     * @return
     */
    @GetMapping("prePayList")
    public HttpResult prePayList(PrePayPage prePayPage) {
        return HttpResult.ok(walletService.prePayList2(prePayPage));
    }

}
