import { Result, deleteRequest, get, post, put } from "../base";

/**
 * 分页查询
 * @param query .
 * @returns .
 */
export function queryPage<T>(query?: any): Promise<Result<T>> {
  return get("/sys/pay/order/page", query);
}

/**
 * 列表查询
 * @param query .
 * @returns .
 */
export function queryList<T>(query?: any): Promise<Result<T>> {
  return get("/sys/pay/order/list", query);
}

/**
 * 新增
 * @param data .
 * @returns .
 */
export function save<T>(data: any): Promise<Result<T>> {
  return post("/sys/pay/order/save", data);
}

/**
 * 更新
 * @param id .
 * @param data .
 * @returns  .
 */
export function update<T>(id: string, data: any): Promise<Result<T>> {
  return put(`/sys/pay/order/update/${id}`, {}, data);
}


/**
 * 订单统计
 * @param query .
 * @returns .
 */
export function orderTotal<T>(query?: any): Promise<Result<T>> {
  return get("/sys/pay/order/orderTotal", query);
}


/**
 * 查询支付状态
 * @param id .
 * @returns  .
 */
export function queryPayStatus<T>(id: string): Promise<Result<T>> {
  return get(`/sys/pay/order/status/${id}`,{});
}


/**
 * 订单回调
 * @param id .
 * @returns  .
 */
export function orderCallback<T>(id: string): Promise<Result<T>> {
  return get(`/sys/pay/order/callback/${id}`,{});
}


/**
 * 首页统计
 * @param id .
 * @returns  .
 */
export function total<T>(): Promise<Result<T>> {
  return get(`/sys/pay/order/total`);
}
