import request from "@/utils/request";

/**
 * 获取店铺设置
 * @returns
 */
export function byShopId() {
  let shopId = localStorage.getItem("shopId");
  return request({
    url: `/tbShopShare/byShopId`,
    method: "get",
    params: {
      shopId: shopId
    }
  });
}

/**
 * 分享-新增/编辑
 * @returns
 */
export function tbShopShare(data) {
  return request({
    url: "/tbShopShare",
    method: data.id ? "put" : "post",
    data
  });
}

/**
 * 邀请记录
 * @returns
 */
export function byShare(data) {
  let shopId = localStorage.getItem("shopId");
  return request({
    url: `/tbShopShare/byShare`,
    method: "post",
    data: {
      shopId: shopId,
      ...data
    }
  });
}
