import request from '@/utils/request';
/**
 * 商家认证接口 - 新增商家认证
 * @param {*} data
 * @returns
 */
export function addMerchantAuth(data) {
  return request({
    url: `/maintain/merchantAuth`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

/**
 * @description 获取商家资质信息
 * @param {*} data
 * @returns
 */

export function getMerchantAuthData(data) {
  return request({
    url: `/maintain/merchantAuth/queryById`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

/**
 * @description 商家认证接口 - 修改商家商家认证
 * @param {*} id 商家id
 * @param {*} data
 * @returns
 */
export function editMerchantAuth(id, data) {
  return request({
    url: `/maintain/merchantAuth/${id}`,
    method: 'PUT',
    headers: {
      'content-type': 'application/json',
    },
    data,
  });
}

/**
 * @description 获取主营业务数组
 * @param {*} data
 * @returns
 */
export function getParentCategoriesData(data) {
  return request({
    url: "/maintain/getParentCategories",
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
    },
  });
}

/**
 * @description 获取辅营业务数组
 * @param {*} data
 * @returns
 */
export function getRootCategoriesData(data) {
  return request({
    url: "/maintain/getRootCategories",
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
/**
 * @description 获取商家钱包
 * @param {*} merchantId 商家id
 * @returns
 */
export function getMerchantPures(merchantId) {
  return request({
    url: `/maintain/asset/merchant/${merchantId}`,
    method: 'get',
    headers: {
      'Content-Type': 'application/json',
    },
  });
}
