Files
JayuCloud/YumiNail-Frontend/src/api/shop.ts
T

109 lines
2.8 KiB
TypeScript
Raw Normal View History

/**
* 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
mapProvider?: string
longitude?: number | string
latitude?: number | string
navigationUrls?: Record<string, string>
2026-02-25 10:37:16 +08:00
businessHours: string
status?: number
authorizationStartDate?: string
authorizationDays?: number
authorizationExpireTime?: string
authorizationExpired?: boolean
authorizationStatusText?: string
coverImageFileId?: string
coverImageUrls?: string[]
2026-02-26 14:20:35 +08:00
imageFileIds: string
imageUrls?: string[]
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 {
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
authorizationStartDate?: string
authorizationDays?: number
authorizationExpireTime?: string
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
authorizationStartDate?: string
authorizationDays?: number
authorizationExpireTime?: string
themePrimaryColor?: string
themeSecondaryColor?: string
themeAccentColor?: string
themePageBgColor?: string
themeCardBgColor?: string
themeBackgroundImageFileId?: string
2026-02-24 09:59:22 +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 = {
getAllShops: async (): Promise<ShopVO[]> => {
return await api.get<ShopVO[]>('/shop/list/all') as unknown as ShopVO[]
2026-02-24 09:59:22 +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
},
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> => {
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
}