import config from "@/config";
import http from "@/utils/request";

export default {
	lists: {
		list: {
			url: `${config.API_URL}member/index/index`,
			name: "获得会员列表",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
		add: {
			url: `${config.API_URL}member/index/add`,
			name: "添加会员",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		edit: {
			url: `${config.API_URL}member/index/edit`,
			name: "编辑会员",
			post: async function (params) {
				return await http.put(this.url, params);
			},
		},
		delete: {
			url: `${config.API_URL}member/index/delete`,
			name: "删除会员",
			post: async function (params) {
				return await http.delete(this.url, params);
			},
		},
		import: {
			url: `${config.API_URL}member/index/import`,
			name: "导入会员",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		export: {
			url: `${config.API_URL}member/index/export`,
			name: "导出会员",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
	},
	level: {
		list: {
			url: `${config.API_URL}member/level/index`,
			name: "获得会员等级列表",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
		add: {
			url: `${config.API_URL}member/level/add`,
			name: "添加会员等级",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		edit: {
			url: `${config.API_URL}member/level/edit`,
			name: "编辑会员等级",
			post: async function (params) {
				return await http.put(this.url, params);
			},
		},
		delete: {
			url: `${config.API_URL}member/level/delete`,
			name: "删除会员等级",
			post: async function (params) {
				return await http.delete(this.url, params);
			},
		},
	},
	field: {
		list: {
			url: `${config.API_URL}member/field/index`,
			name: "获得会员字段列表",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
		add: {
			url: `${config.API_URL}member/field/add`,
			name: "添加会员字段",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		edit: {
			url: `${config.API_URL}member/field/edit`,
			name: "编辑会员字段",
			post: async function (params) {
				return await http.put(this.url, params);
			},
		},
		field: {
			url: `${config.API_URL}member/field/fields`,
			name: "获得会员字段",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
		delete: {
			url: `${config.API_URL}member/field/delete`,
			name: "删除会员字段",
			post: async function (params) {
				return await http.delete(this.url, params);
			},
		},
	},
	extend: {
		list: {
			url: `${config.API_URL}member/extend/index`,
			name: "获得会员扩展列表",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
		audit: {
			url: `${config.API_URL}member/extend/audit`,
			name: "申请审核",
			post: async function (params) {
				return await http.put(this.url, params);
			},
		},
	},
};
