59 lines
1007 B
TypeScript
59 lines
1007 B
TypeScript
import api from './index'
|
|
|
|
export interface ShopVO {
|
|
id: number
|
|
shopName: string
|
|
description: string
|
|
address: string
|
|
businessHours: string
|
|
imageFileIds: string
|
|
imageUrls?: string[]
|
|
createTime: string
|
|
updateTime: string
|
|
}
|
|
|
|
export interface ShopSimpleVO {
|
|
id: number
|
|
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 = {
|
|
getAllShops: () => {
|
|
return api.get<ShopVO[]>('/shop/list/all')
|
|
},
|
|
|
|
getShopsSimple: () => {
|
|
return api.get<ShopSimpleVO[]>('/shop/list/simple')
|
|
},
|
|
|
|
getShopById: (id: number) => {
|
|
return api.get<ShopVO>(`/shop/get/${id}`)
|
|
}
|
|
}
|