feat(health): 积分规则/商品 update/delete + 标签更新端点
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- 积分规则: 添加 update/delete service + handler + 路由
- 兑换商品: 添加 update/delete service + handler + 路由
- 文章标签: 添加 update service + handler + 路由
- Web 管理端: 规则/商品列表页支持编辑/删除/启用切换
- Web 管理端: 标签管理页支持编辑、删除传 version
This commit is contained in:
iven
2026-04-26 14:07:21 +08:00
parent f0076aa240
commit 55ec57b2c0
13 changed files with 504 additions and 71 deletions

View File

@@ -252,11 +252,19 @@ export const articleTagApi = {
return data.data;
},
delete: async (id: string) => {
update: async (id: string, req: { name: string; version: number }) => {
const { data } = await client.put<{
success: boolean;
data: ArticleTagItem;
}>(`/health/article-tags/${id}`, req);
return data.data;
},
delete: async (id: string, version: number) => {
const { data } = await client.delete<{
success: boolean;
data: null;
}>(`/health/article-tags/${id}`);
}>(`/health/article-tags/${id}`, { data: { version } });
return data.data;
},
};

View File

@@ -168,6 +168,20 @@ export const pointsApi = {
return data.data;
},
updateRule: async (id: string, req: Partial<CreatePointsRuleReq> & { is_active?: boolean; version: number }) => {
const { data } = await client.put<{
success: boolean;
data: PointsRule;
}>(`/health/admin/points/rules/${id}`, { data: req, version: req.version });
return data.data;
},
deleteRule: async (id: string, version: number) => {
await client.delete(`/health/admin/points/rules/${id}`, {
data: { version },
});
},
// Products
listProducts: async (params?: Record<string, unknown>) => {
const { data } = await client.get<{
@@ -185,6 +199,20 @@ export const pointsApi = {
return data.data;
},
updateProduct: async (id: string, req: Partial<CreatePointsProductReq> & { is_active?: boolean; version: number }) => {
const { data } = await client.put<{
success: boolean;
data: PointsProduct;
}>(`/health/admin/points/products/${id}`, { data: req, version: req.version });
return data.data;
},
deleteProduct: async (id: string, version: number) => {
await client.delete(`/health/admin/points/products/${id}`, {
data: { version },
});
},
// Orders
listOrders: async (params?: Record<string, unknown>) => {
const { data } = await client.get<{