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

export default {
	family: {
		list: {
			url: `${config.API_URL}account/families/index`,
			name: "家庭列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		detail: {
			url: `${config.API_URL}account/families/detail`,
			name: "家庭详情",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		add: {
			url: `${config.API_URL}account/families/add`,
			name: "家庭添加",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}account/families/edit`,
			name: "家庭编辑",
			post: async function(params){
				return await http.put(this.url, params);
			}
		},
		delete: {
			url: `${config.API_URL}account/families/delete`,
			name: "家庭删除",
			post: async function(params){
				return await http.delete(this.url, params);
			}
		}
	},
	accounts: {
		list: {
			url: `${config.API_URL}account/accounts/index`,
			name: "账户列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		detail: {
			url: `${config.API_URL}account/accounts/detail`,
			name: "账户详情",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		add: {
			url: `${config.API_URL}account/accounts/add`,
			name: "账户添加",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}account/accounts/edit`,
			name: "账户编辑",
			post: async function(params){
				return await http.put(this.url, params);
			}
		},
		delete: {
			url: `${config.API_URL}account/accounts/delete`,
			name: "账户删除",
			post: async function(params){
				return await http.delete(this.url, params);
			}
		}
	},
	members: {
		list: {
			url: `${config.API_URL}account/members/index`,
			name: "成员列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		detail: {
			url: `${config.API_URL}account/members/detail`,
			name: "成员详情",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		add: {
			url: `${config.API_URL}account/members/add`,
			name: "成员添加",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}account/members/edit`,
			name: "成员编辑",
			post: async function(params){
				return await http.put(this.url, params);
			}
		},
		delete: {
			url: `${config.API_URL}account/members/delete`,
			name: "成员删除",
			post: async function(params){
				return await http.delete(this.url, params);
			}
		}
	},
	records: {
		list: {
			url: `${config.API_URL}account/records/index`,
			name: "记录列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		detail: {
			url: `${config.API_URL}account/records/detail`,
			name: "记录详情",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		add: {
			url: `${config.API_URL}account/records/add`,
			name: "记录添加",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}account/records/edit`,
			name: "记录编辑",
			post: async function(params){
				return await http.put(this.url, params);
			}
		},
		delete: {
			url: `${config.API_URL}account/records/delete`,
			name: "记录删除",
			post: async function(params){
				return await http.delete(this.url, params);
			}
		}
	}
}
