// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/libs/request';


/**
 * @description 获取商户分类列表
 */
export function lst(data) {
	return request({
		url: `merchant/category/lst`,
		method: 'get',
		data,
	});
}

/**
 * @description 新增商户分类
 */
export function addcreate(data) {
	return request({
		url: `merchant/category/create`,
		method: 'POST',
		data,
	});
}

/**
 * @description 新增商户分类
 */
export function getCreate(data) {
	return request({
		url: `merchant/category/getCreate`,
		method: 'get',
		data,
	});
}


/**
 * @description 获取商户分类详情
 */
export function getedit(data, id) {
	return request({
		url: `merchant/category/${id}/edit`,
		method: 'get',
		data,
	});
}

/**
 * @description 修改商户分类信息
 */
export function editcategory(data, id) {
	return request({
		url: `merchant/category/update/${id}`,
		method: 'POST',
		data,
	});
}

/**
 * @description 删除商户分类
 */
export function deletecategory(data, id) {
	return request({
		url: `merchant/category/delete/${id}`,
		method: 'get',
		data,
	});
}

/**
 * @description  获取权限
 */
export function getRole(data) {
	return request({
		url: `merchant/type/getRole`,
		method: 'get',
		data,
	});
}

/**
 * @description  删除类型
 */
export function deleteType(data, id) {
	return request({
		url: `merchant/type/delete/${id}`,
		method: 'get',
		data,
	});
}

/**
 * @description  更新类型类型
 */
export function updataType(data, id) {
	return request({
		url: `merchant/type/update/${id}`,
		method: 'POST',
		data,
	});
}

/**
 * @description  获取修改信息
 */
export function getType(data, id) {
	return request({
		url: `merchant/type/${id}/edit`,
		method: 'get',
		data,
	});
}

/**
 * @description  添加类型
 */
export function addType(data) {
	return request({
		url: `merchant/type/create`,
		method: 'POST',
		data,
	});
}


/**
 * @description  获取类型列表
 */
export function typeList(data) {
	return request({
		url: `merchant/type/lst`,
		method: 'get',
		data,
	});
}

/**
 * @description  拒绝申请
 */
export function refuse(data, id) {
	return request({
		url: `merchant/intention/refuse/${id}`,
		method: 'get',
		params: data,
	});
}

/**
 * @description  同意申请
 */
export function adopt(data, id) {
	return request({
		url: `merchant/intention/adopt/${id}`,
		method: 'get',
		data,
	});
}


/**
 * @description  申请列表
 *  * @param {Object} param data {Object} 申请列表传值
 */
export function intentionList(data) {
	return request({
		url: `merchant/intention/lst`,
		method: 'get',
		params: data,
	});
}


/**
 * @description  修改密码
 */
export function changepwd(data, id) {
	return request({
		url: `merchant/admin/update/${id}`,
		method: 'post',
		data,
	});
}

/**
 * @description  更新商户数据
 */
export function updataadmin(data, id) {
	return request({
		url: `merchant/update/${id}`,
		method: 'post',
		data,
	});
}

/**
 * @description  添加商户
 */
export function addadmin(data) {
	return request({
		url: `merchant/create`,
		method: 'post',
		data,
	});
}


/**
 * @description  获取商户详情
 */
export function getmerchent(data, id) {
	return request({
		url: `merchant/${id}/edit`,
		method: 'get',
		data,
	});
}

/**
 * @description  获取商户列表
 *  *  * @param {Object} param data {Object} 商户列表传值
 */
export function merchentlist(data) {
	return request({
		url: `merchant/lst`,
		method: 'get',
		params: data
	});
}

/**
 * @description  后台-商户-禁用/正常
 */
export function forbidden(data) {
	return request({
		url: `merchant/forbidden`,
		method: 'POST',
		data,
	});
}

/**
 * @description  后台-商户-开启关闭
 */
export function openMerchant(data) {
	return request({
		url: `merchant/openMerchant`,
		method: 'POST',
		data,
	});
}


/**
 * @description  后台-商户-开启关闭
 */
export function merchantLoginApi(data, id) {
	return request({
		url: `merchant/login/${id}`,
		method: 'get',
		data,
	});
}
/**
 * @description  后台-商户商品审核-开启关闭
 */
export function openMerchantProduct(data) {
	return request({
		url: `/merchant/openMerchantProduct`,
		method: 'post',
		data,
	});
}