import { ResPage, StoreUser } from "@/api/interface/index";
import { PORT_NONE } from "@/api/config/servicePort";
import http from "@/api";
import httpApi from "@/api/indexApi";

/**
 * @name 商铺用户模块
 */

//获取商铺经营板块列表
export const getBusinessSection = () => {
  return httpApi.get(`/alienStorePlatform/storePlatformRenovation/getBusinessSection`, {}, { loading: false });
};

//获取商铺经营种类列表
export const getBusinessSectionTypes = params => {
  return httpApi.get(`/alienStorePlatform/storePlatformRenovation/getBusinessSectionTypes`, params, { loading: false });
};

//所在地区
export const getDistrict = (params?: any) => {
  return httpApi.get(`/alienStore/gaode/getDistrict`, params, { loading: false });
};

export const getStoreDetail = params => {
  return httpApi.get(`/alienStorePlatform/storePlatformRenovation/getDecorationDetail`, params);
};

//保存店铺信息
export const saveStoreInfo = (params: any) => {
  return httpApi.post(`/alienStorePlatform/storePlatformInfo/saveOrUpdate`, params);
};

//编辑店铺信息
export const editStoreInfo = (params: any) => {
  return httpApi.post(`/alienStorePlatform/storePlatformInfo/saveOrUpdate`, params);
};
// 入口图查询
export const getEntranceImg = (data: any) => {
  return httpApi.get(`/alienStore/img/getByStoreId?storeId=${data}&imgType=1`);
};
//入口图保存
export const saveEntranceImg = (params: any) => {
  return httpApi.post(`/alienStore/img/saveOrUpdateImg`, params);
};
// 门店头图查询
export const getStoreHeadImg = (data: any, imgType: any) => {
  return httpApi.get(`alienStore/img/getByStoreId?storeId=${data}&imgType=${imgType}`);
};
//门店头图保存
export const saveStoreHeadImg = (params: any) => {
  return httpApi.post(`/alienStore/img/saveOrUpdateImg`, params);
};

//批量新增或编辑营业时间
export const addOrEditBusinessTime = (params: any) => {
  return httpApi.post(`/alienStorePlatform//storePlatformBusinessInfo/saveOrUpdateList`, params);
};

//获取营业时间列表
export const getBusinessTimeList = (params: any) => {
  return httpApi.get(`/alienStorePlatform/storePlatformBusinessInfo/getByStoreId`, params);
};

//创建/更新官方相册
export const createOrUpdateOfficialAlbum = (params: any) => {
  return httpApi.post(`/alienStorePlatform/storePlatformOfficial/createOrUpdateOfficialAlbum`, params);
};
//删除官方相册
export const deleteOfficialAlbum = (params: any) => {
  return httpApi.post(`/alienStorePlatform/storePlatformOfficial/deleteOfficialAlbum`, params);
};
//获取官方相册列表
export const getOfficialAlbumList = (params: any) => {
  return httpApi.get(`/alienStorePlatform/storePlatformOfficial/getOfficialAlbumList`, params);
};
//相册内图片存储
export const saveOfficialImg = (params: any) => {
  return httpApi.post(`/alienStore/img/saveOrUpdate`, params);
};
//相册内图片删除
export const deleteOfficialImg = (params: any) => {
  return httpApi.post(`alienStore/img/delete`, params);
};
//相册内图片查询
export const getOfficialImgList = (businessId, storeId) => {
  return httpApi.get(`/alienStore/img/getByBusinessId?businessId=${businessId}&imgType=2&storeId=${storeId}`);
};
//新建或修改菜品
export const createOrUpdateDish = (params: any) => {
  return httpApi.post(`/alienStorePlatform/menuPlatform/saveOrUpdate`, params);
};
//获取门店菜品列表
export const getDishList = (params: any) => {
  return httpApi.get(`/alienStorePlatform/menuPlatform/getMenuByStoreId`, params);
};

//获取菜品详情
export const getDishDetail = (params: any) => {
  return httpApi.get(`/alienStorePlatform/menuPlatform/getMenuInfo`, params);
};
//获取所有标签类型
export const getAllTagType = (params?: any) => {
  return httpApi.get(`/alienStorePlatform/storePlatformTag/getBusinessRelationTagList`, params);
};
//获取所有所选标签
export const getAllTag = (params: any) => {
  return httpApi.get(`/alienStorePlatform/storePlatformTag/getTagStoreRelationByStoreId`, params);
};
//保存标签
export const saveTag = (params: any) => {
  return httpApi.post(`/alienStorePlatform/storePlatformTag/createOrUpdateTagStoreRelation`, params);
};
