
import request from '@/utils/request'
// 获取应用信息列表
export function getAppInfoList(params) {
  return request({
    url: '/apihub/api/page',
    method: 'get',
    params: params
  })
}

export function getAppCategoryList(params) {
  return request({
    url: '/apihub/api-category/list',
    method: 'get',
    params: params
  })
}


export function getAppInfoDetail(params, config) {
  return request({
    url: '/apihub/api/get',
    method: 'get',
    params: params,
    ...(config || {})
  })
}

  // 商家信息
  export function getMerchantInfo(params) {
  return request({
    url: '/api/v1/merchantInfo',
    method: 'get',
    params: params
  })
}

// 相关API
export function getAppRecommendList(params) {
  return request({
    url: '/api/v1/appRecommend',
    method: 'get',
    params: params
  })
}


export function createApiOrderSubmit(query){
  return request({
    url: '/apihub/api-order/create',
    method: 'post',
    data: query
  })
}

// === 老的微信支付接口（保留以便回退） ===
export function createPay(query){
  return request({
    url: '/pay/order/submit',
    method: 'post',
    data: query
  })
}

// === 新的WPGJ支付接口 ===
// 创建API订单(旺铺聚合支付)
export function createApiOrderSubmitWpgj(query){
  return request({
    url: '/apihub/api-order/create-wpgj',
    method: 'post',
    data: query
  })
}

// WPGJ旺铺聚合支付订单查询（与算力资源模块共用）
export function getWpgjOrder(id) {
  return request({
    url: '/pay/order/wpgj-get',
    method: 'get',
    params: {
      id
    }
  })
}
