import { request } from '../../boot/axios';
import { BinListSearchEntity } from '../bin/model/bin';
import { Pagination } from '../class';
import { MenuEntity } from './model/permission';

class MenuFun {
  getPage = (val?: Pagination<BinListSearchEntity>) => {
    return request.postForPage('menu/treePage', val);
  };
  getTree = () => {
    return request.get('menu/tree');
  };

  edit = (val?: MenuEntity) => {
    return request.put('menu/edit', val);
  };
  save = (val?: MenuEntity) => {
    return request.post('menu/save', val);
  };
  delete = (val?: any) => {
    return request.delete('menu/delete/' + val);
  };
  showHiddenMenu = (val?: any) => {
    return request.get('menu/showHiddenMenu/' + val);
  };
  checkBoxList = () => {
    return request.get('role/check-box-list/');
  };
}
const menuFun = new MenuFun();
export { menuFun };
