From 9d8ef3a592b3102c8d4133e601b31aacb91866f6 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期二, 05 八月 2025 10:34:54 +0800 Subject: [PATCH] fix: 修改功能模块 --- src/services/api/menu.ts | 66 +++++++++++++++++++++++++++------ 1 files changed, 54 insertions(+), 12 deletions(-) diff --git a/src/services/api/menu.ts b/src/services/api/menu.ts index d122313..9823244 100644 --- a/src/services/api/menu.ts +++ b/src/services/api/menu.ts @@ -2,8 +2,8 @@ // @ts-ignore import { request } from '@/utils/request'; -/** 鍒犻櫎鑿滃崟 DELETE /api/user/menu/deleteMenu */ -export async function menuDeleteMenu(body: API.DeleteMenuCommand, options?: API.RequestConfig) { +/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 DELETE /api/user/menu/deleteMenu */ +export async function deleteMenu(body: API.DeleteMenuCommand, options?: API.RequestConfig) { return request<number>('/api/user/menu/deleteMenu', { method: 'DELETE', headers: { @@ -14,22 +14,40 @@ }); } -/** 鏌ヨ鑿滃崟璇︽儏 GET /api/user/menu/getMenu */ -export async function menuGetMenu(body: API.GetMenuQuery, options?: API.RequestConfig) { +/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 GET /api/user/menu/getMenu */ +export async function getMenu( + // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄) + params: API.APIgetMenuParams, + options?: API.RequestConfig +) { return request<API.GetMenuQueryResult>('/api/user/menu/getMenu', { method: 'GET', - headers: { - 'Content-Type': 'application/json-patch+json', + params: { + ...params, }, - data: body, ...(options || {}), }); } -/** 鏌ヨ鑿滃崟鍒楄〃 GET /api/user/menu/getMenus */ -export async function menuGetMenus(body: API.GetMenusQuery, options?: API.RequestConfig) { +/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 GET /api/user/menu/getMenus */ +export async function getMenus( + // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄) + params: API.APIgetMenusParams, + options?: API.RequestConfig +) { return request<API.GetMenusQueryResultItem[]>('/api/user/menu/getMenus', { method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }); +} + +/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 POST /api/user/menu/saveMenu */ +export async function saveMenu(body: API.SaveMenuCommand, options?: API.RequestConfig) { + return request<string>('/api/user/menu/saveMenu', { + method: 'POST', headers: { 'Content-Type': 'application/json-patch+json', }, @@ -38,9 +56,9 @@ }); } -/** 淇濆瓨鑿滃崟 POST /api/user/menu/saveMenu */ -export async function menuSaveMenu(body: API.SaveMenuCommand, options?: API.RequestConfig) { - return request<string>('/api/user/menu/saveMenu', { +/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 POST /api/user/menu/saveMenuButton */ +export async function saveMenuButton(body: API.SaveMenuButtonCommand, options?: API.RequestConfig) { + return request<string>('/api/user/menu/saveMenuButton', { method: 'POST', headers: { 'Content-Type': 'application/json-patch+json', @@ -49,3 +67,27 @@ ...(options || {}), }); } + +/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 POST /api/user/menu/saveMenuField */ +export async function saveMenuField(body: API.SaveMenuFieldCommand, options?: API.RequestConfig) { + return request<string>('/api/user/menu/saveMenuField', { + method: 'POST', + headers: { + 'Content-Type': 'application/json-patch+json', + }, + data: body, + ...(options || {}), + }); +} + +/** 姝ゅ鍚庣娌℃湁鎻愪緵娉ㄩ噴 PUT /api/user/menu/setMenuSwitch */ +export async function setMenuSwitch(body: API.SetMenuSwitchCommand, options?: API.RequestConfig) { + return request<number>('/api/user/menu/setMenuSwitch', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json-patch+json', + }, + data: body, + ...(options || {}), + }); +} -- Gitblit v1.9.1