后台管理页面店铺管理初版

This commit is contained in:
xiaowang
2026-02-25 14:44:50 +08:00
parent 38c396fb27
commit d46372a779
4 changed files with 103 additions and 47 deletions
+42
View File
@@ -160,4 +160,46 @@ export const adminProductApi = {
}
}
export interface Shop {
id: number
shopName: string
description: string
address: string
businessHours: string
coverImageFileId: string
coverImageUrl?: string
createTime: string
updateTime: string
}
export interface ShopListResponse {
list: Shop[]
total: number
page: number
size: number
}
export interface CreateShopRequest {
shopName: string
description: string
address: string
businessHours: string
coverImageFileId: string
}
export const adminShopApi = {
listShops: (params: { page: number; size: number; keyword?: string }) => {
return adminApi.get<ShopListResponse>('/admin/shops/list', { params })
},
createShop: (data: CreateShopRequest) => {
return adminApi.post<number>('/admin/shops/create', data)
},
updateShop: (id: number, data: CreateShopRequest) => {
return adminApi.put<boolean>(`/admin/shops/update/${id}`, data)
},
deleteShop: (id: number) => {
return adminApi.delete<boolean>(`/admin/shops/delete/${id}`)
}
}
export default adminApi