import request from '@/utils/request'
import { AxiosPromise } from 'axios'

// apiUrl 扩展配置
const api = {
	page: '/sys/configure/page',
	create: '/sys/configure/create',
	update: '/sys/configure/update',
	delete: '/sys/configure/delete'
}
/**
 * 扩展配置 - 列表
 */
function configurePageApi(data: any): AxiosPromise {
	return request({
		url: api.page,
		method: 'post',
		data
	})
}

/**
 * 扩展配置 - 新增编辑保存
 */
function configureAddOrEditSaveApi(data: any): AxiosPromise {
	return request({
		url: data.id ? api.update : api.create,
		method: 'post',
		data
	})
}

/**
 * 扩展配置 - 删除
 */
function configureDeleteApi(data: any): AxiosPromise {
	return request({
		url: api.delete,
		method: 'post',
		data
	})
}
export default {
	configurePageApi,
	configureAddOrEditSaveApi,
	configureDeleteApi
}
