import {
  IdParam,
  MemberDetail,
  LockActivity,
  LockActivityParam,
  ManualPayParam,
  WalletAddressParam,
  Symbol,
  FilterSearchParam,
  TradePageResult
} from '@/types/api/member/detail';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';


/**
 * "会员管理" => "会员详情"
 * @param data
 */
export function memberDetail(data: IdParam): AxiosPromise<MemberDetail> {
  return request({
    url: 'admin/member/detail',
    method: 'post',
    params: data
  });
}

/**
 * "活动管理"=>"活动管理"=>"活动列表"
 */
export function lockedActivityList(): AxiosPromise<LockActivity[]> {
  return request({
    url: 'admin/activity/activity/locked-activity',
    method: 'post'
  });
}

/**
 * "会员管理" => "会员详情"=>"锁仓"
 * @param data
 */
export function lockMemberCoin(data: LockActivityParam): any {
  return request({
    url: 'admin/activity/activity/lock-member-coin',
    method: 'post',
    params: data
  });
}

/**
 * "会员管理" => "会员详情"=>"人工充币"
 * @param data
 */
export function manualPay(data: ManualPayParam): any {
  return request({
    url: 'admin/member/member-wallet/recharge',
    method: 'post',
    params: data
  });
}

/**
 * "会员管理" => "会员详情"=>"锁定钱包"
 * @param data
 */
export function lockWallet(data: WalletAddressParam): any {
  return request({
    url: 'admin/member/member-wallet/lock-wallet',
    method: 'post',
    params: data
  });
}

/**
 * "会员管理" => "会员详情"=>"解锁钱包"
 * @param data
 */
export function unlockWallet(data: WalletAddressParam): any {
  return request({
    url: 'admin/member/member-wallet/unlock-wallet',
    method: 'post',
    params: data
  });
}

/**
 * "会员管理" => "会员详情"=>"重置地址"
 * @param data
 */
export function resetMemberAddr(data: WalletAddressParam): any {
  return request({
    url: 'admin/member/member-wallet/reset-address',
    method: 'post',
    params: data
  });
}


/**
 * "币币管理"=>"转账地址所有币种"
 */
export function getCoinName(): AxiosPromise<Symbol[]> {
  return request({
    url: 'admin/system/coin/all-name-and-unit',
    method: 'post',
  });
}

/**
 * "财务管理" => "个人记录"
 * @param data
 */
export function perTradeAll(data: FilterSearchParam): AxiosPromise<TradePageResult> {
  return request({
    url: 'admin/finance/member-transaction/page-query',
    method: 'post',
    params: data
  });
}