后台管理页面店铺管理初版
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user