feat: 会员商品收藏

This commit is contained in:
dongshanshan
2023-10-31 16:53:44 +08:00
parent 5d760d5450
commit 9a3253ad20
6 changed files with 253 additions and 3 deletions

View File

@ -0,0 +1,28 @@
import request from '@/config/axios'
export interface Favorite {
id?: number
userId?: string // 用户编号
spuId?: number | null // 商品 SPU 编号
}
// 获得 ProductFavorite 列表
export const getFavoritePage = (params: PageParam) => {
params.keyword = params.name
return request.get({ url: '/product/favorite/page', params })
}
// 收藏商品 Favorite
export const createFavorite = (data: Favorite) => {
return request.post({ url: '/product/favorite/create', data })
}
// 取消商品收藏 Favorite
export const delFavorite = (data: Favorite) => {
return request.delete({ url: '/product/favorite/delete', data })
}
// 是否收藏过商品 Favorite
export const exitsFavorite = (data: Favorite) => {
return request.post({ url: '/product/favorite/exits', data })
}