import axiosInstance from "@/api/axios.ts";
import type {IMenuSearch} from "@/interface/page/menu/IMenuSearch.ts";
import type {IAppBaseMenu} from "@/model/table/IAppBaseMenu.ts";
import type {IBaseMenuPermissionVo} from "@/model/table/IBaseMenuPermissionVo.ts";

export default class MenuApi {
    // 模糊查询菜单
    static queryMenu(queryData: IMenuSearch) {
        return axiosInstance.post("/app/menu/queryMenu", queryData);
    }
    // 添加菜单
    static addMenu(menuData: IAppBaseMenu) {
        return axiosInstance.post("/app/menu/addMenu", menuData);
    }
    // 删除菜单
    static deleteWithMenuId(menuId: string) {
        return axiosInstance.delete("/app/menu/deleteMenu/" + menuId);
    }
    // 更新菜单信息
    static updateMenu(menuData: IAppBaseMenu) {
        return axiosInstance.post("/app/menu/updateMenu", menuData);
    }
    // 查询菜单权限
    static queryMenuPermission(menuId?: string) {
        return axiosInstance.get("/app/menu/queryMenuPermission/" + menuId);
    }
    // 添加菜单权限
    static addMenuPermission(menuPermissionData: IBaseMenuPermissionVo) {
        return axiosInstance.post("/app/menu/addBaseMenuPermission", menuPermissionData);
    }
    // 删除菜单权限
    static deleteMenuPermission(permissionId: string) {
        return axiosInstance.delete("/app/menu/deleteBaseMenuPermission/" + permissionId);
    }

}