后台管理页面初版
This commit is contained in:
@@ -2,18 +2,46 @@ import api from './index'
|
||||
|
||||
export interface ShopVO {
|
||||
id: number
|
||||
shopName: string
|
||||
address: string
|
||||
phone: string
|
||||
businessHours: string
|
||||
name: string
|
||||
description: string
|
||||
image: string
|
||||
phone: string
|
||||
address: string
|
||||
businessHours: string
|
||||
status: number
|
||||
createTime: string
|
||||
updateTime: string
|
||||
}
|
||||
|
||||
export interface ShopSimpleVO {
|
||||
id: number
|
||||
shopName: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface ListShopsParams {
|
||||
page: number
|
||||
size: number
|
||||
keyword?: string
|
||||
}
|
||||
|
||||
export interface CreateShopRequest {
|
||||
name: string
|
||||
description: string
|
||||
image: string
|
||||
phone: string
|
||||
address: string
|
||||
businessHours: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export interface UpdateShopRequest {
|
||||
name?: string
|
||||
description?: string
|
||||
image?: string
|
||||
phone?: string
|
||||
address?: string
|
||||
businessHours?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
export const shopApi = {
|
||||
@@ -27,5 +55,21 @@ export const shopApi = {
|
||||
|
||||
getShopById: (id: number) => {
|
||||
return api.get<ShopVO>(`/shop/get/${id}`)
|
||||
},
|
||||
|
||||
listShops: (params: ListShopsParams) => {
|
||||
return api.get<any>('/admin/shop/list', { params })
|
||||
},
|
||||
|
||||
createShop: (data: CreateShopRequest) => {
|
||||
return api.post('/admin/shop/create', data)
|
||||
},
|
||||
|
||||
updateShop: (id: number, data: UpdateShopRequest) => {
|
||||
return api.put(`/admin/shop/update/${id}`, data)
|
||||
},
|
||||
|
||||
deleteShop: (id: number) => {
|
||||
return api.delete(`/admin/shop/delete/${id}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user