package com.sqx.modules.pay.controller;

import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.service.UserMoneyDetailsService;
import com.sqx.modules.pay.controller.query.WalletDetailQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

@RestController
@Api(value = "钱包明细", tags = {"管理平台"})
@RequestMapping(value = "/wallet")
public class WalletDetailController {

    @Resource
    private UserMoneyDetailsService userMoneyDetailsService;

    @ApiOperation("钱包明细列表")
    @GetMapping("list")
    public Result walletDetailList(WalletDetailQuery query) {
        PageUtils result = userMoneyDetailsService.walletDetailList(query);
        return Result.success().put("data", result);
    }

    @ApiOperation("钱包明细统计")
    @GetMapping("statistics")
    public Result walletDetailStatistics(WalletDetailQuery query) {
        BigDecimal result = userMoneyDetailsService.walletDetailStatistics(query);
        return Result.success().put("data", result);
    }
}
