/** * 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. */ import api from './index' import type { IdType } from '@/utils/id' export interface ShopVO { id: IdType shopName: string description: string address: string mapProvider?: string longitude?: number | string latitude?: number | string navigationUrls?: Record businessHours: string status?: number authorizationStartDate?: string authorizationDays?: number authorizationExpireTime?: string authorizationExpired?: boolean authorizationStatusText?: string coverImageFileId?: string coverImageUrls?: string[] imageFileIds: string imageUrls?: string[] themePrimaryColor?: string themeSecondaryColor?: string themeAccentColor?: string themePageBgColor?: string themeCardBgColor?: string themeBackgroundImageFileId?: string createTime: string updateTime: string } export interface ShopSimpleVO { id: string | number shopName?: string 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 authorizationStartDate?: string authorizationDays?: number authorizationExpireTime?: string themePrimaryColor?: string themeSecondaryColor?: string themeAccentColor?: string themePageBgColor?: string themeCardBgColor?: string themeBackgroundImageFileId?: string } 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 } /** * 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. */ export const shopApi = { getAllShops: async (): Promise => { return await api.get('/shop/list/all') as unknown as ShopVO[] }, getPublicShops: async (): Promise => { return await api.get('/shop/list/public') as unknown as ShopVO[] }, getShopsSimple: async (): Promise => { return await api.get('/shop/list/simple') as unknown as ShopSimpleVO[] }, getShopById: async (id: IdType): Promise => { return await api.get(`/shop/get/${id}`) as unknown as ShopVO } }