import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { UserUserMenuVO } from './types';

/**
 * 添加设置
 * @param query
 */
export const addMenu = (data: UserUserMenuVO) => {
  return request({
    url: '/system/userCommonUseMenu',
    method: 'post',
    data: data
  });
};

/**
 * 删除设置
 * @param query
 */
export const delMenu = (menuId: number | string) => {
  return request({
    url: '/system/userCommonUseMenu/' + menuId,
    method: 'delete'
  });
};

/**
 * 获取设置
 * @param query getCommonMenu
 */
export const getCommonMenu = (): AxiosPromise<UserUserMenuVO[]> => {
  return request({
    url: '/system/userCommonUseMenu/getCommonMenu',
    method: 'get'
  });
};
