import { request } from 'umi';
import { api } from '../api'
/**修改微信菜单 */
export async function editMenu(params: { mpId: string, mpMenuDtos: any, menuId: string }) {
    let { mpId, mpMenuDtos, menuId } = params
    return request(`${api}/system/mp/menu/modify${menuId ? '/' + menuId : ''}`, {
        method: 'PUT',
        data: { ...mpMenuDtos, mpId }
    });
}
/**同步微信菜单 */
export async function syncMenu(params: { mpId: string }) {
    return request(`${api}/system/mp/menu/sync/${params.mpId}`, {
        method: 'PUT',
    });
}
/**同步IOS安卓菜单 */
export async function syncPlatform(params: { platform: string, menuId: string }) {
    return request(`${api}/system/mp/menu/syncPlatform/${params.platform}/${params.menuId}`, {
        method: 'PUT',
    });
}
/**删除微信菜单 */
export async function delMenu(params: { menuId: string }) {
    return request(`${api}/system/mp/menu/del/${params.menuId}`, {
        method: 'DELETE',
    });
}
/**获取微信菜单 */
export async function getMenu(params: { mpId: string }) {
    return request(`${api}/system/mp/menu/all/${params.mpId}`);
}
