import request from "@/utils/request"

// 签到
export const createRewardSignInRecord = (data) => {
  return request({
    url: '/app-api/menduner/reward/sign-in/record/create',
    method: 'POST',
    data,
    custom: {
      auth: true,
      showLoading: false
    }
  })
}


// 获得个人签到统计
export const getRewardSignInRecordSummary = () => {
  return request({
    url: '/app-api/menduner/reward/sign-in/record/get-summary',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获得签到记录分页
export const getRewardSignInRecordPage = (pageNo, pageSize) => {
  return request({
    url: `/app-api/menduner/reward/sign-in/record/page?pageSize=${pageSize}&pageNo=${pageNo}`,
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获取签到规则列表
export const getRewardSignInConfigList = () => {
  return request({
    url: '/app-api/menduner/reward/sign-in/config/list',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: false
    }
  })
}

// 获取账户余额
export const getAccountBalance = () => {
  return request({
    url: '/app-api/pay/wallet/get',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获取积分余额
export const getUserAccount = () => {
  return request({
    url: '/app-api/menduner/system/mde-user/get/account',
    method: 'GET',
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 福利 领领取优惠券
export const takeCoupon = (templateId) => {
  return request({
    url: '/app-api/promotion/coupon/take',
    method: 'POST',
    data: { templateId },
    custom: {
      auth: true,
      showLoading: true,
      loadingMsg: '领取中',
      showSuccess: true,
      successMsg: '领取成功'
    }
  })
}
// 福利 优惠券ID
export const getDiyTemplate = (ids) => {
  return request({
    url: '/app-api/promotion/coupon-template/list-by-ids',
    method: 'GET',
    params: {
      ids
    },
    custom: {
      auth: true,
      showError: false,
      showLoading: false,
    }
  })
}
// 福利 获取商城模板
export const getDiyTemplateUsed = () => {
  return request({
    url: '/app-api/promotion/diy-template/used',
    method: 'GET',
    custom: {
      auth: true,
      showError: false,
      showLoading: false,
    }
  })
}



// 获取优惠券模板分页
export const getCouponTemplatePage = (params) => {
  return request({
    url: '/app-api/promotion/coupon-template/page',
    method: 'GET',
    params,
    custom: {
      auth: false,
      showError: false,
      showLoading: false,
    }
  })
}

// 我的优惠劵列表
export const getCouponPage = (params) => {
  return request({
    url: '/app-api/promotion/coupon/page',
    method: 'GET',
    params,
    custom: {
      auth: true,
      showError: false,
      showLoading: false,
    }
  })
}

// 获得钱包充值记录分页
export const getUserWalletRechargePage = async (params) => {
  return request({
    url: '/app-api/pay/wallet-recharge/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 获得钱包流水分页
export const getUserWalletTransactionPage = async (params) => {
  return request({
    url: '/app-api/pay/wallet-transaction/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}

// 账户变动记录
export const getEnterpriseAccountRecordPage = async (params) => {
  return request({
    url: '/app-api/menduner/system/recruit/enterprise/account/record/page',
    method: 'GET',
    params,
    custom: {
      showLoading: false,
      auth: true
    }
  })
}