import http from "@/utils/request"

export default {
	device: {
		list: async function(data, config={}){
			return await http.get("v1/device/list", data, config);
		},
		del: async function(data, config={}){
			return await http.delete("v1/device/del", data, config);
		},
		add: async function(data, config={}){
			return await http.post("v1/device/add", data, config);
		},
		edit: async function(data, config={}){
			return await http.put("v1/device/edit", data, config);
		},
	},
	group: {
		list: async function(data={}){
			return await http.get("v1/group/list", data);
		},
		option: async function(data={}){
			return await http.get("v1/group/option", data);
		},
		add: async function(data={}){
			return await http.post("v1/group/add", data);
		},
		edit: async function(data={}){
			return await http.put("v1/group/edit", data);
		},
		del: async function(data={}){
			return await http.delete("v1/group/del", data);
		},
	},
	topic: {
		list: async function(data={}){
			return await http.get("v1/topic/list", data);
		},
		option: async function(data={}){
			return await http.get("v1/topic/option", data);
		},
		add: async function(data={}){
			return await http.post("v1/topic/add", data);
		},
		edit: async function(data={}){
			return await http.put("v1/topic/edit", data);
		},
		del: async function(data={}){
			return await http.delete("v1/topic/del", data);
		},
	}
}
