2026-02-24 09:59:22 +08:00
|
|
|
import api from './index'
|
|
|
|
|
|
|
|
|
|
export interface ShopVO {
|
|
|
|
|
id: number
|
2026-02-26 14:20:35 +08:00
|
|
|
shopName: string
|
2026-02-24 09:59:22 +08:00
|
|
|
description: string
|
2026-02-25 10:37:16 +08:00
|
|
|
address: string
|
|
|
|
|
businessHours: string
|
2026-03-26 10:28:28 +08:00
|
|
|
status?: number
|
2026-02-26 14:20:35 +08:00
|
|
|
imageFileIds: string
|
|
|
|
|
imageUrls?: string[]
|
2026-02-24 09:59:22 +08:00
|
|
|
createTime: string
|
|
|
|
|
updateTime: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ShopSimpleVO {
|
2026-03-21 14:33:33 +08:00
|
|
|
id: string | number
|
|
|
|
|
shopName?: string
|
|
|
|
|
name?: string
|
2026-02-25 10:37:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
2026-02-24 09:59:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const shopApi = {
|
2026-03-26 10:28:28 +08:00
|
|
|
getAllShops: async (): Promise<ShopVO[]> => {
|
|
|
|
|
return await api.get<ShopVO[]>('/shop/list/all') as unknown as ShopVO[]
|
2026-02-24 09:59:22 +08:00
|
|
|
},
|
|
|
|
|
|
2026-03-26 10:28:28 +08:00
|
|
|
getPublicShops: async (): Promise<ShopVO[]> => {
|
|
|
|
|
return await api.get<ShopVO[]>('/shop/list/public') as unknown as ShopVO[]
|
2026-02-24 09:59:22 +08:00
|
|
|
},
|
|
|
|
|
|
2026-03-26 10:28:28 +08:00
|
|
|
getShopsSimple: async (): Promise<ShopSimpleVO[]> => {
|
|
|
|
|
return await api.get<ShopSimpleVO[]>('/shop/list/simple') as unknown as ShopSimpleVO[]
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getShopById: async (id: number): Promise<ShopVO> => {
|
|
|
|
|
return await api.get<ShopVO>(`/shop/get/${id}`) as unknown as ShopVO
|
2026-02-24 09:59:22 +08:00
|
|
|
}
|
2026-02-25 10:37:16 +08:00
|
|
|
}
|