import { http } from "/@/utils/http"
import { loadEnv } from "@build/index";

const { VITE_PROXY_USER_REAL } = loadEnv();

const baseUrl = `${VITE_PROXY_USER_REAL}/admin/`;

interface ResponseType extends Promise<any> {
  message?: string
  code?: number
  data?: any
}

// 列表
export const httpList = (data: any): ResponseType => {
  return http.request('post', `${baseUrl}paylist`, {
    data: { ...data }
  })
}

// 添加
export const httpCreate = (data: any): ResponseType => {
  return http.request('post', `${baseUrl}ComonOrder/payCreate`, { data })
}

// 详情
export const httpDetail = (data: any): ResponseType => {
  return http.request('post', `${baseUrl}tradeloginfo`, { data })
}

// 审核状态
export const httpStatus = (data: any): ResponseType => {
  return http.request('post', `${baseUrl}orderpaystatus`, { data })
}
