package com.red.circle.console.adapter.app.team;

import com.red.circle.console.app.dto.clienobject.team.TeamExchangeTargetCO;
import com.red.circle.console.app.service.app.team.TeamExchangeTargetBackService;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.inner.model.cmd.team.TeamExchangeTargetBackQryCmd;
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 pengshigang on 2023/5/25
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/team/exchange/target")
public class TeamExchangeTargetRestController extends BaseController {

  private final TeamExchangeTargetBackService teamExchangeTargetBackService;

  /**
   * 记录.
   */
  @GetMapping("/list")
  public List<TeamExchangeTargetCO> listByCondition(
      TeamExchangeTargetBackQryCmd query) {
    return teamExchangeTargetBackService.listByCondition(query);
  }

  /**
   * 兑换USD总额.
   */
  @GetMapping("/usd-total")
  public String getExchangeUsdTotal(
      TeamExchangeTargetBackQryCmd query) {
    return teamExchangeTargetBackService.getExchangeUsdTotal(query);
  }

}
