import http from '../utils/http';
import config from '../config/config';

/**
 * 获取商店基础信息
 * @author Seven
 * @data 2025-3-27
 * @returns {  }
 * @see https://mall.gpxscs.cn/api/admin/shop/shop-store-base/get
 */

export function GetShopBaseInfo() {
  return http({
    url: '/shop/shop-store-base/get?source_lang=zh_CN',
    method: 'get',
    baseURL: config.adminApi,
  });
}

/**
 * 修改商店基础信息
 * @author Seven
 * @data 2025-3-27
 * @param {
 *  store_logo: '',                                               店铺logo
 *  store_slogan: '加油',                                          店铺口号
 *  store_tel: this.form.info.store_tel,                          店铺电话
 *  company_description: this.form.company.company_description,    店铺介绍
 * }
 * @returns {  }
 * @see https://mall.gpxscs.cn/api/admin/shop/shop-store-base/storeSetUp
 */

export function UpdataShopInfo(params) {
  return http({
    url: '/shop/shop-store-base/storeSetUp',
    method: 'post',
    params,
    baseURL: config.adminApi,
  });
}

/**
 * 获取商家端今日订单量
 * @author Seven
 * @data 2025-4-30
 * @returns {  }
 * @see https://mall.gpxscs.cn/api/admin/shop/analytics/order/getOrderNumToday
 */

export function GetShopOrderNum() {
  return http({
    url: '/shop/analytics/order/getOrderNumToday',
    method: 'get',
    baseURL: config.adminApi,
  });
}

/**
 * 获取商家端今日销售额
 * @author Seven
 * @data 2025-4-30
 * @returns {  }
 * @see https://mall.gpxscs.cn/api/admin/pay/analytics/trade/getSalesAmount
 */

export function GetSalesAmountFun(params) {
  return http({
    url: '/pay/analytics/trade/getSalesAmount',
    method: 'get',
    params,
    baseURL: config.adminApi,
  });
}

/**
 * 获取商家端今日退货单数
 * @author Seven
 * @data 2025-4-30
 * @returns {  }
 * @see https://mall.gpxscs.cn/api/admin/shop/analytics/return/getReturnNumToday
 */

export function GetOrderReturnNum(params) {
  return http({
    url: 'shop/analytics/return/getReturnNumToday',
    method: 'get',
    params,
    baseURL: config.adminApi,
  });
}
