import api from './index.js'

/**
 * 订单相关API接口
 */

// 获取会员套餐列表
export const getPlans = () => {
  return api.get('/plans')
}

// 创建订单
export const createOrder = (data) => {
  return api.post('/orders', data)
}

// 获取订单支付信息
export const getOrderPayment = (orderNo, params) => {
  return api.get(`/orders/${orderNo}/payment`, { params })
}

// 查询单个订单状态
export const getOrderDetail = (orderNo) => {
  return api.get(`/orders/${orderNo}`)
}

// 获取我的订单列表
export const getMyOrders = (params = {}) => {
  return api.get('/orders/my', { params })
}

// 购买内容
export const purchaseContent = (data) => {
  return api.post('/content/purchase', data)
} 