
/**
 * Web唐明明
 * 匆匆数载恍如梦，岁月迢迢华发增。
 * 碌碌无为枉半生，一朝惊醒万事空。
 * moduleName: 商品
 */

import { request } from '../index'


// 商品管理-商品列表
const managesGoodsIndex = data => {
	return request({
		url: 'manages/goods/index',
		data:data
	})
}

// 商品管理-商品增发
const managesGoodsMint = data => {
	return request({
		url: 'manages/goods/'+data.id+'/mint',
		data:data,
		method:'POST'
	})
}

// 商品管理-商品燃烧
const managesGoodsBurn = data => {
	return request({
		url: 'manages/goods/'+data.id+'/burn',
		data:data,
		method:'POST'
	})
}

// 发布商品前置
const managesGoodsCreateBefore = () => {
	return request({
		url: 'manages/goods/create'
	})
}

// 发布商品
const managesGoodsCreate = (data) => {
	return request({
		url: 'manages/goods',
		method:'POST',
		data:data
	})
}

// 发布产品类目
const managesCategory = () => {
	return request({
		url: 'manages/goods/category'
	})
}

// 发布产品类目类型配置
const managesCreate = (data) => {
	return request({
		url: 'manages/goods/create',
		data
	})
}

// 商品认证
const managesGoodsAuth = (id, data) => {
	return request({
		url: 'manages/goods/' + id + '/extends',
		method:'POST',
		data
	})
}

// 商品删除
const managesGoodsDelete = id => {
	return request({
		url: 'manages/goods/' + id,
		method:'DELETE'
	})
}

// 产品信息
const managesGoodsEdit = id => {
	return request({
		url: 'manages/goods/' + id
	})
}

// 产品编辑
const managesGoodsPut = (id, data) => {
	return request({
		url: 'manages/goods/' + id,
		method: 'PUT',
		data
	})
}

// 产品附加信息
const managesGoodsExtends = id => {
	return request({
		url: 'manages/goods/' + id + '/extends',
	})
}

export {
	managesGoodsIndex,
	managesGoodsMint,
	managesGoodsBurn,
	managesGoodsCreateBefore,
	managesGoodsCreate,
	managesCategory,
	managesGoodsAuth,
	managesGoodsDelete,
	managesGoodsEdit,
	managesCreate,
	managesGoodsPut,
	managesGoodsExtends
}
