import { http } from '@/utils/http'

/** 账号登录 */
export const loginAPI = (data) => {
  return http.post<{ token: string }>('/api/v1/LoginUser', data)
}

/** 修改密码 */
export const updateUserAPI = (data) => {
  return http.post('/api/v1/UpgradeUser', data)
}

/** 注册账号 */
export const registerAPI = (data) => {
  return http.post<{ token: string }>('/api/v1/RegisterUser', data)
}
/** 用户信息 */
export const getUserInfoAPI = () => {
  return http.post<IUserInfo>('/api/v1/getUserInfo')
}

/** 退出登录 */
export const logoutAPI = () => {
  return http.post('/api/v1/Logiout')
}

/** 实名认证 */
export const createAuthUser = (data) => {
  return http.post('/api/v1/CreateAuthUser', data)
}

/** 轮播列表 */
export const getBannerListAPI = () => {
  return http.post<any[]>('/api/v1/getSwipeList')
}

/** 新闻列表 */
export const getNewsListAPI = (data) => {
  return http.post<any[]>('/api/v1/getNewsList', data)
}

/** 新闻详情 */
export const getNewsDetailAPI = (data) => {
  return http.post<any>('/api/v1/getNewsDetail', data, data)
}

/** 公司简介 */
export const getCompanyInfoAPI = () => {
  return http.post<any>('/api/v1/getCompanyProfile')
}

/** 基金列表 */
export const getFundListAPI = () => {
  return http.post<any[]>('/api/v1/getFundList')
}
/** 购买基金   */
export const buyFundAPI = (data) => {
  return http.post('/api/v1/buyFundOrder', data)
}

/** 购买基金订单列表 */
export const getBuyFundOrderListAPI = (data) => {
  return http.post<any[]>('/api/v1/getFundOrderList', data)
}

/** 房屋列表 */
export const getHouseListAPI = () => {
  return http.post<{ list: any[] }>('/api/v1/getHouseList')
}

/** 购买房屋 */
export const buyHouseAPI = (data) => {
  return http.post('/api/v1/buyHouseOrder', data)
}

/** VIP列表 */
export const getVipListAPI = () => {
  return http.post<{ list: any[] }>('/api/v1/getVipList')
}

/** 购买VIP */
export const buyVIPAPI = (data) => {
  return http.post('/api/v1/buyFundOrder', data)
}

/** 我的团队 */
export const getMyTeamAPI = (data) => {
  return http.post<{ list: any[] }>('/api/v1/getMyTeam', data)
}

/** 绑定收款卡号 */
export const bindBankCardAPI = (data) => {
  return http.post('/api/v1/CreateCardUser', data)
}

/** 删除收款卡号 */
export const deleteBankCardAPI = (data) => {
  return http.post('/api/v1/CannelUserCard', data)
}

/** 获取银行卡列表 */
export const getBankCardListAPI = (data) => {
  return http.post<{ list: any[] }>('/api/v1/getCardList', data)
}

/** 申请提现 */
export const applyWithdrawalAPI = (data) => {
  return http.post('/api/v1/CreateWithdrawal', data)
}

/** 提现记录 */
export const getWithdrawalRecordAPI = (data) => {
  return http.post<{ list: any[] }>('/api/v1/WithdrawalOrder', data)
}

/** 余额明细 */
export const getBalanceRecordsAPI = (data) => {
  return http.post<{ list: any[] }>('/api/v1/getBalanceRecords', data)
}

/** 系统充收款账号列表 */
export const getSystemRechargeAccountAPI = (data) => {
  return http.post<{ list: any[] }>('/api/v1/getWalletList', data)
}

/** 充值 */
export const rechargeAPI = (data) => {
  return http.post('/api/v1/CreateRechangeOrder', data)
}

/** 充值记录 */
export const getRechargeRecordAPI = (data) => {
  return http.post<{ list: any[] }>('/api/v1/getRechangeOrder', data)
}
