package com.kym.miniapp.controller;

import com.kym.common.R;
import com.kym.service.miniapp.WalletDetailService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户账户表 前端控制器
 * </p>
 *
 * @author skyline
 * @since 2023-08-07
 */
@RestController
@RequestMapping("/account/")
public class AccountController {

    private final WalletDetailService walletDetailService;

    public AccountController(WalletDetailService walletDetailService) {
        this.walletDetailService = walletDetailService;
    }

    /**
     * 钱包明细
     *
     * @param type
     * @return
     */
    @GetMapping("/walletDetail")
    public R walletDetail(@RequestParam(name = "type", defaultValue = "0", required = false) int type) {
        return R.success(walletDetailService.listWalletDetail(type));
    }

}
