标签功能初版实现

This commit is contained in:
xiaowang
2026-02-24 09:59:22 +08:00
parent c5018b14a5
commit aa0aca2ac0
56 changed files with 2273 additions and 305 deletions
+59
View File
@@ -0,0 +1,59 @@
import api from './index'
export interface ProductVO {
id: number
shopId: number
shopName: string
title: string
description: string
imageFileIds: string
imageUrls: string[]
price: number
tags: string
tagList: string[]
likeCount: number
collectCount: number
approximateDuration: string
bookableArtists: string
availableCoupons: string
createTime: string
updateTime: string
}
export interface ProductDTO {
shopId: number
title: string
description: string
imageFileIds: string
price: number
tags: string
approximateDuration: string
bookableArtists: string
availableCoupons: string
}
export const productApi = {
getAllProducts: () => {
return api.get<ProductVO[]>('/product/list/all')
},
getProductById: (id: number) => {
return api.get<ProductVO>(`/product/get/${id}`)
},
getProductsByTag: (tag: string) => {
return api.get<ProductVO[]>(`/product/list/tag/${tag}`)
},
createProduct: (data: ProductDTO) => {
return api.post<ProductVO>('/product/add', data)
},
updateProduct: (id: number, data: ProductDTO) => {
return api.put<ProductVO>(`/product/update/${id}`, data)
},
deleteProduct: (id: number) => {
return api.delete(`/product/delete/${id}`)
}
}