import request from '@/utils/request';

export async function pageCmmssn(params) {
  const res = await request.get('/cmmssn/cmmssn/page', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 导出
 * @param params 查询条件
 */
export async function exportCmmssn(params) {
  const res = await request.get('/cmmssn/cmmssn/export', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function updateCmmssnSend(data) {
  const res = await request.put('/cmmssn/cmmssn', data);
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

/**
 * 导出金额未支付金额大于100的用户
 * @param params 查询条件
 */
export async function exportCmmssnLgMoney(params) {
  const res = await request.get('/cmmssn/cmmssn/exportLgMoney', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
