2026-05-18 09:46:11 +08:00
|
|
|
/**
|
|
|
|
|
* Front-end API wrapper for this module.
|
|
|
|
|
* Call guide: import the named API object, then call the matching method from a Vue page or composable.
|
|
|
|
|
*/
|
2026-02-24 09:59:22 +08:00
|
|
|
import api from './index'
|
2026-03-27 14:55:41 +08:00
|
|
|
import type { IdType } from '@/utils/id'
|
2026-02-24 09:59:22 +08:00
|
|
|
|
|
|
|
|
export interface ShopVO {
|
2026-03-27 14:55:41 +08:00
|
|
|
id: IdType
|
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
|
2026-05-18 09:46:11 +08:00
|
|
|
mapProvider?: string
|
|
|
|
|
longitude?: number | string
|
|
|
|
|
latitude?: number | string
|
|
|
|
|
navigationUrls?: Record<string, string>
|
2026-02-25 10:37:16 +08:00
|
|
|
businessHours: string
|
2026-03-26 10:28:28 +08:00
|
|
|
status?: number
|
2026-05-21 18:43:59 +08:00
|
|
|
authorizationStartDate?: string
|
|
|
|
|
authorizationDays?: number
|
2026-05-18 09:46:11 +08:00
|
|
|
authorizationExpireTime?: string
|
|
|
|
|
authorizationExpired?: boolean
|
|
|
|
|
authorizationStatusText?: string
|
2026-03-26 10:53:19 +08:00
|
|
|
coverImageFileId?: string
|
|
|
|
|
coverImageUrls?: string[]
|
2026-02-26 14:20:35 +08:00
|
|
|
imageFileIds: string
|
|
|
|
|
imageUrls?: string[]
|
2026-05-21 18:43:59 +08:00
|
|
|
themePrimaryColor?: string
|
|
|
|
|
themeSecondaryColor?: string
|
|
|
|
|
themeAccentColor?: string
|
|
|
|
|
themePageBgColor?: string
|
|
|
|
|
themeCardBgColor?: string
|
|
|
|
|
themeBackgroundImageFileId?: 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
|
2026-05-21 18:43:59 +08:00
|
|
|
authorizationStartDate?: string
|
|
|
|
|
authorizationDays?: number
|
2026-05-18 09:46:11 +08:00
|
|
|
authorizationExpireTime?: string
|
2026-05-21 18:43:59 +08:00
|
|
|
themePrimaryColor?: string
|
|
|
|
|
themeSecondaryColor?: string
|
|
|
|
|
themeAccentColor?: string
|
|
|
|
|
themePageBgColor?: string
|
|
|
|
|
themeCardBgColor?: string
|
|
|
|
|
themeBackgroundImageFileId?: string
|
2026-02-25 10:37:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface UpdateShopRequest {
|
|
|
|
|
name?: string
|
|
|
|
|
description?: string
|
|
|
|
|
image?: string
|
|
|
|
|
phone?: string
|
|
|
|
|
address?: string
|
|
|
|
|
businessHours?: string
|
|
|
|
|
status?: number
|
2026-05-21 18:43:59 +08:00
|
|
|
authorizationStartDate?: string
|
|
|
|
|
authorizationDays?: number
|
2026-05-18 09:46:11 +08:00
|
|
|
authorizationExpireTime?: string
|
2026-05-21 18:43:59 +08:00
|
|
|
themePrimaryColor?: string
|
|
|
|
|
themeSecondaryColor?: string
|
|
|
|
|
themeAccentColor?: string
|
|
|
|
|
themePageBgColor?: string
|
|
|
|
|
themeCardBgColor?: string
|
|
|
|
|
themeBackgroundImageFileId?: string
|
2026-02-24 09:59:22 +08:00
|
|
|
}
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
/**
|
|
|
|
|
* shopApi groups all API calls for this page domain.
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
*/
|
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[]
|
|
|
|
|
},
|
|
|
|
|
|
2026-03-27 14:55:41 +08:00
|
|
|
getShopById: async (id: IdType): Promise<ShopVO> => {
|
2026-03-26 10:28:28 +08:00
|
|
|
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
|
|
|
}
|