31 lines
550 B
TypeScript
31 lines
550 B
TypeScript
import api from './index'
|
|||
|
|
|
||
|
|
export interface ShopVO {
|
||
|
|
id: number
|
||
|
|
shopName: string
|
||
|
|
address: string
|
||
|
|
phone: string
|
||
|
|
businessHours: string
|
||
|
|
description: string
|
||
|
|
createTime: string
|
||
|
|
updateTime: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface ShopSimpleVO {
|
||
|
|
id: number
|
||
|
|
shopName: string
|
||
|
|
}
|
||
|
|
|
||
|
|
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}`)
|
||
|
|
}
|
||
|
|
}
|