package com.red.circle.wallet.adapter.app;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.wallet.app.dto.cmd.GoldRunningWaterQueryCmd;
import com.red.circle.wallet.app.service.GoldWalletService;
import com.red.circle.wallet.inner.model.tmp.AssetRecordRunningWaterCO;
import java.math.BigDecimal;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 金币钱包服务.
 *
 * @author pengliang on 2023/9/11
 * @eo.api-type http
 * @eo.groupName 钱包服务.金币钱包
 * @eo.path /wallet/gold
 */
@RestController
@RequestMapping("/gold")
@RequiredArgsConstructor
public class GoldWalletRestController extends BaseController {

  private final GoldWalletService goldWalletService;

  /**
   * 我的金币余额.
   *
   * @eo.name 我的金币余额.
   * @eo.url /balance
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/balance")
  public BigDecimal getBalance(AppExtCommand cmd) {
    return goldWalletService.getBalance(cmd);
  }

  /**
   * 本月资产记录.
   *
   * @eo.name 本月资产记录.
   * @eo.url /this-month/asset-record
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping(value = "/this-month/asset-record")
  public List<AssetRecordRunningWaterCO> listThisMonthAssetRecord(GoldRunningWaterQueryCmd cmd) {
    return goldWalletService.listThisMonthAssetRecord(cmd);
  }


}
