import request from "@/utils/request";
const market_baseURL = "/market";
const order_baseURL = "/order";

/**
 * 积分:配置:详情
 * @param {*} params 
 * @returns 
 */
export function pointsConfigGet(params) {
  return request({
    url: `${market_baseURL}/admin/points/config`,
    method: "get",
    params,
  });
}

/**
 * 积分:配置:新增/更新
 * @param {*} params 
 * @returns 
 */
export function pointsConfigPost(data) {
  return request({
    url: `${market_baseURL}/admin/points/config`,
    method: "post",
    data,
  });
}

/**
 * 积分:商品:新增/修改
 * @param {*} params 
 * @returns 
 */
export function pointsGoodsPost(data) {
  return request({
    url: `${market_baseURL}/admin/pointsGoods`,
    method: "post",
    data,
  });
}

/**
 * 积分:商品:列表
 * @param {*} params 
 * @returns 
 */
export function pointsGoodsPage(params) {
  return request({
    url: `${market_baseURL}/admin/pointsGoods/page`,
    method: "get",
    params,
  });
}

/**
 * 积分-商品-删除
 * @param {*} id 
 * @returns 
 */
export function pointsGoodsDel(id) {
  return request({
    url: `${market_baseURL}/admin/pointsGoods/${id}`,
    method: "delete"
  });
}

/**
 * 积分:积分商品:兑换记录
 * @param {*} params
 * @returns
 */
export function goodsRecordPage(params) {
  return request({
    url: `${order_baseURL}/admin/points/goodsRecord/page`,
    method: "get",
    params,
  });
}

/**
 * 积分:积分商品:兑换统计
 * @param {*} params
 * @returns
 */
export function goodsRecordTotal(params) {
  return request({
    url: `${order_baseURL}/admin/points/goodsRecord/total`,
    method: "get",
    params,
  });
}

/**
 * 积分:积分商品:兑换统计
 * @param {*} params
 * @returns
 */
export function pointsUserPage(params) {
  return request({
    url: `${market_baseURL}/admin/points/userPage`,
    method: "get",
    params,
  });
}

/**
 * 积分:用户:积分详情
 * @param {*} params
 * @returns
 */
export function pointsUserRecord(params) {
  return request({
    url: `${market_baseURL}/admin/points/userRecord`,
    method: "get",
    params,
  });
}

/**
 * 积分:商品:商家核销
 * @param {*} params 
 * @returns 
 */
export function goodsRecordCheckout(data) {
  return request({
    url: `${order_baseURL}/admin/points/goodsRecord/checkout`,
    method: "post",
    data,
  });
}

/**
 * 积分:商家 退单/同意退单
 * @param {*} params 
 * @returns 
 */
export function goodsRecordAgreeRefund(data) {
  return request({
    url: `${order_baseURL}/admin/points/goodsRecord/agreeRefund`,
    method: "post",
    data,
  });
}

/**
 * 积分:商家 驳回退单
 * @param {*} params 
 * @returns 
 */
export function goodsRecordRejectRefund(data) {
  return request({
    url: `${order_baseURL}/admin/points/goodsRecord/rejectRefund`,
    method: "post",
    data,
  });
}

