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

export default {
    list: {
        url: `${config.API_URL}/role`,
        name: "身份列表",
        get: async function (params = {}) {
            return await http.get(this.url, params);
        },
    },
    create: {
        url: `${config.API_URL}/role/create`,
        name: "身份添加菜单树",
        get: async function () {
            return await http.get(this.url);
        },
    },
    save: {
        url: `${config.API_URL}/role/save`,
        name: "身份保存",
        post: async function (data = {}) {
            return await http.post(this.url, data);
        },
    },
    edit: {
        url: `${config.API_URL}/role/edit`,
        name: "身份编辑数据",
        get: async function (id) {
            return await http.get(`${this.url}/${id}`);
        },
    },
    del: {
        url: `${config.API_URL}/role/del`,
        name: "身份删除",
        delete: async function (id) {
            return await http.delete(`${this.url}/${id}`);
        },
    },
    setStatus: {
        url: `${config.API_URL}/role/set_status`,
        name: "身份状态",
        get: async function (id, status) {
            return await http.get(`${this.url}/${id}/${status}`);
        },
    },
};
