import { request } from 'umi';
import { getDataBaseUrl,getgroupmealUrl } from '@/global_data';

export default {
	GetAllStore() {
		return request(getgroupmealUrl()+'/api/shop/alllist', {
			method: 'GET'
		});
	},
	GetCosRequestURL(data) {
		return request(getgroupmealUrl()+`/api/SysService/GetPresignUploadUrl`, {
			method: 'POST',
			data: data,
		});
	},

	//-----------------------页面管理 start---------------------
	//分页查询
	MiniPageList(params) {
		return request(getgroupmealUrl()+'/api/AppletService/page', {
			method: 'POST',
			data: {
				...params
			}
		});
	},

	/**
		 * 添加页面
		 * @param {*} params 
		 * @returns 
		 */
	MiniPageAdd(params) {
		return request(getgroupmealUrl()+'/api/AppletService/add', {
			method: 'POST',
			data: {
				...params
			}
		});
	},

	/**
		 * 更新页面
		 * @param {*} params 
		 */
	MiniPageUpdate(params) {
		return request(getgroupmealUrl()+'/api/AppletService/update', {
			method: 'POST',
			data: {
				...params
			}
		});
	},

	/**
		 * 删除
		 * @param {*} id 
		 * @returns 
		 */
	MiniPageDelete(id) {
		return request(getgroupmealUrl()+'/api/AppletService/del', {
			method: 'POST',
			data: {
				id
			}
		});
	},



	//-----------------------页面管理 end---------------------


	//-----------------------素材管理 start---------------------

	/**
		 * 根据店铺id查询素材
		 */
	MinimaterialListByStore(params) {
		return request(getgroupmealUrl()+`/api/AppletService/MiniStoreMaterial`, {
			method: 'POST',
			data: params,
		});
	},

	/**
		 * 添加素材
		 * @param {*} params 
		 * @returns 
		 */
	AddMinimaterial(params) {
		return request(getgroupmealUrl()+`/api/AppletService/MaterialAdd`, {
			method: 'POST',
			data: params,
		});
	},

	/**
	 * 更新素材
	 * @param {*} params 
	 */
	UpdateMiniMaterial(params) {
		return request(getgroupmealUrl()+`/api/AppletService/MaterialUpdate`, {
			method: 'POST',
			data: params,
		});
	},

		/**
	 * 删除素材
	 */
		DeleteMiniMaterial(id) {
			return request(getgroupmealUrl()+`/api/AppletService/MaterialDel`, {
				method: 'POST',
				data: {
					id
				},
			});
		},


	//-----------------------素材管理 end---------------------


}