import request from './request'
const api = {
    'goodsList': '/toCmtsw/MtswToC/goodsList',          //获取商品列表
    'getGoodsMsg': '/toCmtsw/MtswToC/getGoodsMsg',      //获取商品信息
    'getAddressList': '/mtsw/address/getAddressList',   //获取地址列表
    'addAddress': '/mtsw/address/addAddress',           //添加地址
    'editAddress': '/mtsw/address/editAddress',         //编辑地址
    'delAddress': '/mtsw/address/delAddress',           //删除地址
    'createOrder': '/mtsw/order/createOrder',           //提交订单
}

export const goodsList = (data) => {
	return request.get(api['goodsList'],data);
}
export const getGoodsMsg = (data) => {
	return request.get(api['getGoodsMsg'],data);
}
export const getAddressList = (data) => {
	return request.get(api['getAddressList'],data);
}
export const addAddress = (data) => {
	return request.post(api['addAddress'],data);
}
export const editAddress = (data) => {
	return request.post(api['editAddress'],data);
}
export const delAddress = (data) => {
	return request.post(api['delAddress'],data);
}
export const createOrder = (data) => {
	return request.post(api['createOrder'],data);
}
export default {
	goodsList,
	getGoodsMsg,
	getAddressList,
	addAddress,
	editAddress,
	delAddress,
	createOrder,
}