package com.red.circle.other.app.service.activity;

import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.app.dto.clientobject.activity.LotteryActivityCO;
import com.red.circle.other.app.dto.clientobject.activity.LotteryActivityDetailCO;
import com.red.circle.other.app.dto.clientobject.activity.LotteryDrawResultCO;
import com.red.circle.other.app.dto.clientobject.activity.LotteryMultiDrawResultCO;
import com.red.circle.other.app.dto.clientobject.activity.LotteryRankCO;
import com.red.circle.other.app.dto.clientobject.activity.LotteryRecordCO;
import com.red.circle.other.app.dto.clientobject.activity.LotteryTicketCO;
import com.red.circle.other.app.dto.clientobject.activity.LotteryWinnerHistoryCO;
import com.red.circle.other.app.dto.clientobject.activity.LotteryWithdrawAmountCO;
import com.red.circle.other.app.dto.clientobject.activity.LotteryWithdrawCO;
import com.red.circle.other.app.dto.clientobject.activity.MyTotalDrawCountCO;
import com.red.circle.other.app.dto.cmd.activity.*;

import java.util.List;

/**
 * 抽奖活动服务.
 *
 * @author system
 * @since 2025-10-18
 */
public interface LotteryActivityRestService {

  /**
   * 获取有效活动列表.
   */
  List<LotteryActivityCO> listValidActivities(AppExtCommand cmd);

  /**
   * 获取活动详情.
   */
  LotteryActivityDetailCO getActivityDetail(String activityCode, AppExtCommand cmd);

  /**
   * 执行抽奖.
   */
  LotteryDrawResultCO draw(LotteryDrawCmd cmd);

  /**
   * 执行连抽.
   */
  LotteryMultiDrawResultCO multiDraw(LotteryMultiDrawCmd cmd);

  /**
   * 查询我的中奖记录.
   */
  PageResult<LotteryRecordCO> listMyRecords(LotteryRecordQryCmd cmd);

  /**
   * 查询我的抽奖券.
   */
  List<LotteryTicketCO> listMyTickets(AppExtCommand cmd,  Long activityId);

  /**
   * 获取抽奖券总数.
   */
  Integer getMyTicketCount(AppExtCommand cmd, Long activityId);

  /**
   * 查询我的总抽奖次数.
   */
  MyTotalDrawCountCO getMyTotalDrawCount(AppExtCommand cmd, Long activityId);

  /**
   * 查询排行榜.
   */
  List<LotteryRankCO> getRankList(LotteryRankQryCmd cmd);

  /**
   * 查询历史中奖记录用户.
   */
  List<LotteryWinnerHistoryCO> getWinnerHistory(LotteryWinnerHistoryQryCmd cmd);

  /**
   * 提交提现申请.
   */
  void applyWithdraw(LotteryWithdrawCmd cmd);

  /**
   * 查询提现记录.
   */
  PageResult<LotteryWithdrawCO> listWithdrawRecords(LotteryWithdrawQryCmd cmd);

  /**
   * 查询可提现金额.
   */
  LotteryWithdrawAmountCO getWithdrawAmount(Long userId, Long activityId);

  /**
   * 可提现金额兑换金币.
   */
  void exchangeGold(LotteryExchangeGoldCmd cmd);

  /**
   * 可提现金额转账给指定用户.
   */
  void transfer(LotteryTransferCmd cmd);

  /**
   * 查询抽奖背包流水
   */
  PageResult<com.red.circle.other.inner.model.dto.activity.LotteryBackpackLogCO> queryBackpackLogs(LotteryBackpackLogQryCmd cmd);

}
