import axiosApi from './AxiosApi.js'

const apiList = {
  getPlatformMenu: `/menu/tree`,
  getAllMerchanMenu: `/menu/getAllTenantMenu`,
  getSpecialMerchantMenu: `/menu/getSpecifiedTenantMenu`,
  saveMenu: `/menu/syncMenu`
}
export default {
  // 平台所有菜单
  getPlatformMenu() {
    return axiosApi({
      method: 'GET',
      url: apiList.getPlatformMenu
    })
  },
  // 查询所有商家菜单
  getAllMerchanMenu() {
    return axiosApi({
      method: 'GET',
      url: apiList.getAllMerchanMenu
    })
  },
  // 查询指定商家菜单
  getSpecialMerchantMenu(id) {
    return axiosApi({
      method: 'GET',
      url: `${apiList.getSpecialMerchantMenu}/${id}`
    })
  },
  // 同步菜单
  saveMenu(data) {
    return axiosApi({
      method: 'POST',
      url: apiList.saveMenu,
      data
    })
  }
}
