feat(admin): manage and sync product details

This commit is contained in:
yeuimu
2026-08-21 10:18:57 +08:00
parent 7d09077f1d
commit d375df810d
18 changed files with 507 additions and 106 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
import request from './request'
import type {
Good,
GoodDetail,
CreateGoodRequest,
UpdateGoodRequest,
BatchCreateGoodsRequest,
@@ -17,7 +18,7 @@ export const goodsApi = {
// Get good by id
getGoodById: (id: string) => {
return request.get<any, Good>(`/goods/${id}`)
return request.get<any, GoodDetail>(`/goods/${id}`)
},
// Create good
@@ -44,4 +45,4 @@ export const goodsApi = {
batchUpdatePriority: (data: BatchPriorityRequest) => {
return request.patch<any, { count: number }>('/goods/batch-priority', data)
},
}
}
+10
View File
@@ -10,6 +10,16 @@ export const syncApi = {
return request.post<any, { message: string }>('/sync/categories')
},
syncProductDetails: () => {
return request.post<any, { message: string }>('/sync/product-details')
},
syncOneProductDetail: (goodId: string) => {
return request.post<any, { goodId: string; variants: number; detailSyncedAt: string }>(
`/sync/products/${goodId}/detail`,
)
},
getSyncStatus: (limit?: number) => {
return request.get<any, SyncLog[]>('/sync/status', {
params: limit ? { limit } : undefined,